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

Incompatibility with PHP 8.1 in v4.0.0 #6626

Open
ltrk2 opened this issue Sep 19, 2024 · 4 comments
Open

Incompatibility with PHP 8.1 in v4.0.0 #6626

ltrk2 opened this issue Sep 19, 2024 · 4 comments

Comments

@ltrk2
Copy link

ltrk2 commented Sep 19, 2024

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 7110dc6 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.

@soyuka
Copy link
Member

soyuka commented Sep 19, 2024

My bad, we wanted to support php 8.2 only for v4.0.

@ltrk2
Copy link
Author

ltrk2 commented Sep 19, 2024

@soyuka thank you very much for your quick response! I see that you've also pulled the release, which is great.

@ltrk2 ltrk2 closed this as completed Sep 19, 2024
@ltrk2
Copy link
Author

ltrk2 commented Sep 20, 2024

@soyuka the v4.0.0 release seems to be back on Packagist. Was this intentional by any chance?
If one was using PHP 8.1, running composer install api-platform/core would install this incompatible version.

@ltrk2 ltrk2 reopened this Sep 20, 2024
@lazka
Copy link

lazka commented Sep 24, 2024

It also results in renovate to suggest an update, which fails with an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants