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.3 | Tokenizer/PHP: add support for readonly anonymous classes #309

Merged
merged 1 commit into from
Feb 2, 2024

Commits on Feb 2, 2024

  1. PHP 8.3 | Tokenizer/PHP: add support for readonly anonymous classes

    PHP 8.3 introduced readonly anonymous classes, fixing an oversight in the PHP 8.2 introduction of readonly classes.
    
    As things were, for PHP 8.1+, the tokenizer would change the token code for the `readonly` keyword from `T_READONLY` to `T_STRING` in the "context sensitive keyword" layer, thinking it to be a class name.
    
    And for PHP < 8.1, the readonly polyfill would ignore the token as it being preceded by the `new` keyword would be seen as conflicting with the "context sensitive keyword" layer, which meant it would not be re-tokenized from `T_STRING` to `T_READONLY`.
    
    This commit fixes both.
    
    Includes adding tests in a number of pre-existing test classes to cover this change.
    jrfnl committed Feb 2, 2024
    Configuration menu
    Copy the full SHA
    9244858 View commit details
    Browse the repository at this point in the history