Our great sponsors
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
The implementation is already done and merged. See https://github.com/php/php-src/pull/7571
It makes it harder to extend classes without using inheritance and DI. For example any macros you add with https://github.com/spatie/macroable now can't save any data to the class you are extending, which was useful under some circumstances. The only workaround I can think of would involve some horrible hack involving globals and spl_object_hash.
Another example of extending a class would be adding blade directives. I wrote something like the @once directive before it was added to laravel. (Custom blade directives are added in a similar way to macros). @once basically requires some way of recording what has been compiled, i.e. some state change, and properties are the right tool for that job (and that's how it was done ultimately). Sure I could have used a global variable, or wrote my own class to hold the data or something as there's only one blade compiler at a time, but in general it would mean that if you want to change state you are stuck with creating your item classes every time.
You'd be better off using https://getrector.org/