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

"Call to function property_exists() with <non-final class> and <property-name> will always evaluate to false" in PHP 8.2 #8474

Closed
spawnia opened this issue Dec 6, 2022 · 2 comments

Comments

@spawnia
Copy link

spawnia commented Dec 6, 2022

Bug report

PHPStan is overly eager in determining a call to propery_exists() always returns false in PHP 8.2
when a class does not define a property itself - however its children might define the property.
In case of a final class, the result of property_exists() is indeed fixed.

I believe this change has been introduced due to the deprecation of dynamic properties in PHP 8.2, thus PHPStan
is behaving differently there.

Code snippet that reproduces the problem

https://phpstan.org/r/041cd047-46fc-4250-847f-9bcc62a98c0f

Expected output

No error in the linked snippet, the code works as written (and property_exists() does return different results): https://3v4l.org/3pFPb

@Progi1984
Copy link

I have the same problem : https://phpstan.org/r/b47e3e33-f558-4abb-ae66-a1e7c9fd7f3e

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants