-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
Consistency of __PROPERTY__ magic constant meaning in hook signature #17222
Comments
Huh. I didn't know that I'm fine with making it meaningful in the hook attribute, as it's functionally the same as a method. That... could probably be treated as a non-breaking bug fix if we wanted, but that's not my call. Adding it to property attributes I'd also be in favor of, though I'm not sure if that would also be legal as a bug fix or if it would have to wait for 8.5. I don't think the property default value is distinct enough from the property itself for it to have its own attributes to begin with, so there's nothing to do there. Ilija? |
I don't think BC is a concern yet. This can be treated as a bug IMO. Given the behavior of the other pseudo constants, I think all of these cases should work. |
Description
If I look at what
__METHOD__
does, it has meaning in:Here's a quick proof: https://3v4l.org/EqGLn
When I compare that with
__PROPERTY__
, it only has meaning in:Of course, hook parameter cannot have a default value. But it'd be nice for consistency if it also had meaning in:
Which it currently has not. Additionally, it might be up to discussion, if it should have meaning in:
Here's a quick script to verify: https://3v4l.org/4BMJt#v8.4.2
/cc @iluuu1994 @Crell
PHP Version
PHP 8.4
Operating System
N/A
The text was updated successfully, but these errors were encountered: