-
Notifications
You must be signed in to change notification settings - Fork 740
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
The final
modifier to methods coming from traits
#4189
Comments
Indeed, I made a mistake in this example. Sorry for that and thanks for spotting it! The changelog says "The final modifier may now be used when using a method from a trait.". I'm not 100% sure what it means, then... 🤔 |
This is a common documentation problem, or rather the problem of the word I would forbid using (!)… I would forbid writing (!) this word at all. It is always better to write a specific action instead: call a method, specify a modifier, declare a function, pass a value rather than use a method, use a modifier, use a function, use a value… "The final modifier may now be used…" — how exactly?! :) |
The problem a lot of the times is the people writing the entry in UPGRADING in a way which is kinda useless, so one is just "guessing" what the hell it means. I think for PHP next I am going to push a migration guide and force people to write the entry in it properly on doc-en instead of minimal text in the |
Take a look at this sample code: And try switch to lower PHP version; prior to PHP 8.3.0, You'll get: It seems that it is now clear how the I have propose changes in the last code example in #4188, please correct it if necessary |
Great finding, I wasn't aware of |
Can someone explain what the last code example on the Trait page means? This example works down to PHP 5.4.0:
What exactly was allowed to do with traits and the
final
modifier in PHP 8.3.0?The text was updated successfully, but these errors were encountered: