peachpiecompiler / peachpie

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

some syntax error #1111

Closed xiangyi-wang closed 1 year ago

xiangyi-wang commented 1 year ago

Hi, the string is not recognized in this constructor. I'm not sure whether it's a syntax error or whether it doesn't support this writing method

PHP2014 Syntax error: unexpected token 'Sort' Flarum D:\Flarum\vendor\ramsey\collection\src\Sort.php 20 image PHP2014 Syntax error: unexpected token 'string' Flarum D:\Flarum\vendor\ramsey\collection\src\Set.php 50 image

PHP4087 Argument 1 passed to is() must be of the type Pchp\Core\PhpValue, NULL given
} elseif ($def === null && !Nette\Utils\Validators::is(null, $type)) {

jakubmisek commented 1 year ago

thank you for reporting that! It's a bug in the parser; for now you can workaround it by commenting /*string*/ out.

xiangyi-wang commented 1 year ago

@jakubmisek thanks! I have one more question.How to modify this situation. PHP4085 Property Ramsey\Uuid\Builder\FallbackBuilder::$builders cannot have type iterable Flarum D:\Flarum\vendor\ramsey\uuid\src\Builder\FallbackBuilder.php 33 image

PHP4087 Argument 1 passed to is() must be of the type Pchp\Core\PhpValue, NULL given Flarum D:\Flarum\vendor\nette\schema\src\Schema\Expect.php 89 image

jakubmisek commented 1 year ago

Thank you, the syntax issues were fixed in https://github.com/peachpiecompiler/peachpie/commit/531bcf03a35f5876a55def5b270cdd97fc7ef1c7

I'll prepare a release soon.

jakubmisek commented 1 year ago

fixed, and updated PHP language level (syntax) to 8.2

Thank you @xiangyi-wang !