Skip to content

PHP 8.4 polyfill for Deprecated attribute is not compatible with PHP 8.0 #551

@jrfnl

Description

@jrfnl

The PHP 8.4 polyfills have a minimum supported PHP version of PHP 7.2.

In the polyfill code for the Deprecated attribute uses readonly properties, which are only available in PHP 8.1+:
https://github.com/symfony/polyfill-php84/blob/1.x/Resources/stubs/Deprecated.php

I might be missing something, but I have a feeling that this means that using the (polyfilled) #[Deprecated] attribute in code which also needs to run on PHP 8.0 will lead to a parse error when the class is loaded via the Composer classmap: https://3v4l.org/f9oRo

I don't think the class using readonly and typed properties is a problem on PHP 7.2-7.4 as attributes are not supported, so the class will never be loaded anyway (unless manually requested, in which case I'd call that user-error).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions