core
core copied to clipboard
Incompatibility with PHP 8.1 in v4.0.0
API Platform version(s) affected: 4.0.0
Description
According to the requirement at Packagist, 4.0.0
is supposed to be compatible with PHP 8.1.0+. However, the use of a language feature (https://wiki.php.net/rfc/readonly_classes) supported in PHP 8.2+ introduced in https://github.com/api-platform/core/commit/7110dc665bde47b15dcfe8b1e3198427f8a78938 seems to have broken this, because I get the following error when trying to execute on top of PHP 8.1.29:
Parse error: syntax error, unexpected token "readonly", expecting "abstract" or "final" or "class" in vendor/api-platform/core/src/Hydra/Serializer/HydraPrefixNameConverter.php on line 20
How to reproduce
I'll follow-up with a simple reproduction shortly.