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

PHP 8.2 | Various tests: explicitly declare properties #1170

Commits on Mar 15, 2022

  1. PHP 8.2 | Various tests: explicitly declare properties

    Dynamic (non-explicitly declared) property usage is expected to be deprecated as of PHP 8.2 and will become a fatal error in PHP 9.0.
    
    There are a number of ways to mitigate this:
    * If it's an accidental typo for a declared property: fix the typo.
    * For known properties: declare them on the class.
    * For unknown properties: add the magic `__get()`, `__set()` et al methods to the class or let the class extend `stdClass` which has highly optimized versions of these magic methods build in.
    * For unknown _use of_ dynamic properties, the `#[AllowDynamicProperties]` attribute can be added to the class. The attribute will automatically be inherited by child classes.
    
    This commit addresses a number of issues in the "known property" category within the test suite.
    
    Refs:
    * https://wiki.php.net/rfc/deprecate_dynamic_properties
    jrfnl committed Mar 15, 2022
    Copy the full SHA
    358c21a View commit details
    Browse the repository at this point in the history