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

Fix Utils::getClass() with PHP8 #1563

Merged
merged 3 commits into from
Jul 14, 2021
Merged

Fix Utils::getClass() with PHP8 #1563

merged 3 commits into from
Jul 14, 2021

Conversation

villfa
Copy link
Contributor

@villfa villfa commented Jul 12, 2021

The results of this function differ over PHP versions since from PHP8 anonymous classes names don't necessarily start by class.

This PR takes also into account that get_class_parent() may return false.

@Seldaek
Copy link
Owner

Seldaek commented Jul 13, 2021

As per https://3v4l.org/KRpcr it seems like the parent class is anyway already returned in php8, so do we need this code at all or is get_class() not enough on php8+ ?

@Seldaek Seldaek added this to the 2.x milestone Jul 13, 2021
@villfa
Copy link
Contributor Author

villfa commented Jul 14, 2021

Indeed this function has little value on PHP8+ and could be dropped at the same time than the PHP7 support.

@Seldaek Seldaek merged commit 63e1950 into Seldaek:main Jul 14, 2021
@Seldaek
Copy link
Owner

Seldaek commented Jul 14, 2021

Ok sorry never mind, I had a closer look now and I see your code definitely makes more sense than including stuff like class@anonymous/in/0DSEO:27$0.

Thanks 👍🏻

@villfa villfa deleted the fix/getclass branch July 14, 2021 19:42
@lyrixx lyrixx mentioned this pull request Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants