[RFC] Deprecate dynamic properties has passed!

This page summarizes the projects mentioned and recommended in the original post on /r/PHP

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • PHPT

    The PHP Interpreter

  • The implementation is already done and merged. See https://github.com/php/php-src/pull/7571

  • macroable

    A trait to dynamically add methods to a class

  • 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.

  • 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.

    WorkOS logo
  • Laravel

    The Laravel Framework.

  • 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.

  • Rector

    Instant Upgrades and Automated Refactoring of any PHP 5.3+ code

  • You'd be better off using https://getrector.org/

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts