Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP 8 Compatibility #466

Open
ganigeorgiev opened this issue Jan 5, 2021 · 11 comments
Open

PHP 8 Compatibility #466

ganigeorgiev opened this issue Jan 5, 2021 · 11 comments

Comments

@ganigeorgiev
Copy link

I'm not sure if this is the correct package to report the issue, but I've just upgraded to PHP 8 and got the following error:

Fatal error: Declaration of Go\ParserReflection\Traits\ReflectionClassLikeTrait::getConstants() must be compatible with ReflectionClass::getConstants(?int $filter = null) in /var/www/html/vendor/goaop/parser-reflection/src/ReflectionClass.php on line 214

Is the library supposed to work with PHP 8 or I'm pulling some older transitive dependency?

Here is part of my dependencies tree:

  • codeception/aspect-mock 3.1.0
  • goaop/framework 2.3.0
  • goaop/parser-reflection 2.1.2
@lisachenko
Copy link
Member

Hello! I can confirm that goaop/framework doesn't support PHP8 yet. First, the goaop/parser-reflection should be updated to support PHP8, as there are some important changes in Refection API.

Would you like to work on this? )

@amuluowin
Copy link

From PHP8 News
The upgrading guide specifies that if you extend these classes, and still want to support both PHP 7 and PHP 8, the following signatures are allowed:

ReflectionClass::newInstance($arg = null, ...$args);
ReflectionFunction::invoke($arg = null, ...$args);
ReflectionMethod::invoke($object, $arg = null, ...$args);

When i use classMap some file for goaop/parser-reflection, it work well

@ganigeorgiev
Copy link
Author

@lisachenko I'm not sure from where to start. Are you planning to deprecate goaop/parser-reflection (#465 (comment))? I also noticed that master is quite ahead of the latest stable parser-reflection 2.1.2 release.

@lisachenko
Copy link
Member

Personally, I don't want to deprecate/abandon my own goaop/parser-reflection library, but I see that I don't have enough free time to develop/maintain it. Thus, it will be honest to highlight this and abandon it by switching to BetterReflection package.

Theoretically, I can make parser-reflection working with PHP8 without new features, this can give some time to test/play with current packages and unblock migration to PHP8.

@lisachenko
Copy link
Member

Linked issue: Roave/BetterReflection#701.

So, there are no currently working static reflection libraries supporting PHP8 now, neither my, nor BR is not ready for that.

@lisachenko lisachenko changed the title PHP 8 Compatibility? PHP 8 Compatibility Mar 27, 2021
@jberculo
Copy link

FYI: It seems that BR portability is getting up to speed: Roave/BetterReflection#701

@lisachenko
Copy link
Member

Yes, I’m looking forward to have this PHP8 support added to BR, then need one more step - to migrate my framework to BR

@ilminaev
Copy link

Hi! Are there any updates to that? It seems BetterReflection has added support for PHP 8.

@lisachenko
Copy link
Member

Yep, BR has now PHP8 support, looking for someone who can do integration ) I don't have enough time to do it, so can't promise it will be ready soon...

@WalterWoshid
Copy link

I am currently refactoring the library to support PHP 8.0. See WalterWoshid#1 for progress information

@WalterWoshid
Copy link

Done #486

@goaop goaop deleted a comment from WalterWoshid May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants