peachpiecompiler / peachpie

PeachPie - the PHP compiler and runtime for .NET and .NET Core
https://www.peachpie.io
Apache License 2.0
2.33k stars 202 forks source link

PHP 8: "match" expression not supported #1042

Closed menturion closed 2 years ago

menturion commented 2 years ago

Peachpie.NET.Sdk/1.0.0-appv4839 -> PHP 8

The match expression (see https://www.php.net/manual/en/control-structures.match.php) seems not to be supported.

An issue is thrown e.g. here ... https://github.com/PHPSocialNetwork/phpfastcache/blob/bcd068ff1a78cd1475a4d8c13ed371711465ef40/lib/Phpfastcache/Config/ConfigurationOption.php#L337

phpfastcache\phpfastcache\lib\Phpfastcache\Config\ConfigurationOption.php(337,26): error PHP2014: Syntax error: unexpected token '=>'

jakubmisek commented 2 years ago

thanks!

match is supported (ref https://github.com/peachpiecompiler/peachpie/issues/765) although the default version used by the compiler is 7.4 which does not have match.

You need to set <LangVersion>latest</LangVersion> according to https://docs.peachpie.io/php/msbuild/#langversion

We'll fix that the default version will be 8.0 now

jakubmisek commented 2 years ago

fixed, default parser version is 8.0 now

menturion commented 2 years ago

Many thanks! Just tested with 1.0.0-appv4840. This issue doesn't pop up anymore.

jakubmisek commented 2 years ago

thanks for the confirmation!