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 compability #142

Closed
Tracked by #361 ...
salerat opened this issue Aug 3, 2022 · 19 comments
Closed
Tracked by #361 ...

PHP 8.2 compability #142

salerat opened this issue Aug 3, 2022 · 19 comments
Assignees
Milestone

Comments

@salerat
Copy link

salerat commented Aug 3, 2022

Feature Request

Q A
New Feature yes

Summary

Due installing by composer i get next error while using PHP 8.2 RC:
- laminas/laminas-code 4.7.x-dev requires php >=7.4, <8.2 -> your php version (8.2.0beta1) does not satisfy that requirement.
Looks like this is last package which includes in Symfony 6.2 which not supports PHP 8.2

@Ocramius
Copy link
Member

Ocramius commented Aug 3, 2022

Correct: this package does not yet support PHP 8.2.

PHP 8.2 compatibility will be rolled out once all features from PHP 8.2 are implemented/tested:

@agustingomes
Copy link
Contributor

Now that the PHP 8.2 has reached Release Candidate phase, I think is a good moment to add the new features, and in the process, drop support for PHP 7.4.

I'll personally try to invest some hours in the upcoming weeks to get some of the new 8.2 features in.

@guradia
Copy link

guradia commented Nov 3, 2022

I have a codebase with Symfony 6.1.x at hand, that does work fine under PHP 8.2.
But doing anything with composer gets blocked by this constraint.

So i think the constraint is kind of erroneously applied?

Meaning:
Coming from the view of features this library understands, sure ... it does not support PHP 8.2.
But the constraints applied to a library should be about the compatibility of the library itself.
So to speak: PHP 8.2 understands the library and can run it's things ... the other way around should not be relevant and only be something the documentation of the library states, but does not dictate it can't be installed under higher PHP-Versions.

Addendum:
My understanding of this library is, that it's compatibility is meant in way of what it can statically analyse. And this is separate from it's one execution context. It can probably analyse 8.1 code, even when executed on 8.0?

@Ocramius
Copy link
Member

Ocramius commented Nov 3, 2022

@guradia just cross-referencing: laminas/laminas-diactoros#117 (comment)

As for PHP 8.2 support, hoping to throw some time at this soon: haven't found any yet, and I've already upgraded a few hundred other packages so far. Patience.

@guradia
Copy link

guradia commented Nov 3, 2022

@Ocramius ah, yes. This reasoning about SemVer is totally sound. And to be square with myself: Me going early adopter is obviously calling for trouble and is my problem alone.

Having concluded that, i just ran the test suite for the library under PHP 8.2 and did the composer run with "--ignore-platform-req=php+" for the Symfony codebase. Since i am now being confident with that.

May such a test run be of any contribution value?

@Ocramius Ocramius added this to the 4.8.0 milestone Nov 3, 2022
@Ocramius
Copy link
Member

Ocramius commented Nov 3, 2022

@guradia practically, there's a bunch of stuff in the 4.8.0 milestone that needs to happen before 8.2.0 is considered viable.

In this component's case, "it runs" is not sufficient to declare PHP 8.2 compatibility.

@fezfez
Copy link
Contributor

fezfez commented Nov 20, 2022

Correct: this package does not yet support PHP 8.2.

PHP 8.2 compatibility will be rolled out once all features from PHP 8.2 are implemented/tested:

* https://wiki.php.net/rfc/dnf_types

* https://wiki.php.net/rfc/true-type

* https://wiki.php.net/rfc/readonly_classes

* https://wiki.php.net/rfc/null-false-standalone-types

based on this comment, here is the path to release PHP 8.2 compat

Feature Merge request done?
https://wiki.php.net/rfc/dnf_types No
https://wiki.php.net/rfc/readonly_classes #147 Yes
https://wiki.php.net/rfc/true-type #149 Yes
https://wiki.php.net/rfc/null-false-standalone-types #149 Yes

Is there someone working on https://wiki.php.net/rfc/dnf_types ?

@fezfez
Copy link
Contributor

fezfez commented Nov 20, 2022

@Ocramius
Copy link
Member

Ya, didn't commit anything yet though

@Ocramius
Copy link
Member

@fezfez if you want to do DNF types, the TypeGenerator is mostly @internal, so you can rewrite it completely, if you want :D

@fezfez
Copy link
Contributor

fezfez commented Nov 21, 2022

@fezfez if you want to do DNF types, the TypeGenerator is mostly @internal, so you can rewrite it completely, if you want :D

haha, okay i will probably in the week

@arokettu
Copy link

@guradia practically, there's a bunch of stuff in the 4.8.0 milestone that needs to happen before 8.2.0 is considered viable.

In this component's case, "it runs" is not sufficient to declare PHP 8.2 compatibility.

laminas-code technically has 2 PHP compatibility targets: for a host platform and for a target platform. Currently they are treated as unified but I don't see any good reason for them to be strictly aligned. My current generation target is 5.6 for example and I suspect it to be the most common use case, for people wanting to run their old generation code for old targets on the updated platform

@IonBazan
Copy link
Contributor

Currently they are treated as unified but I don't see any good reason for them to be strictly aligned.

In fact, Readme states that this tool could potentially be used to generate code for other targets:

While the current implementation is limited to generating PHP code, you can easily extend the base class in order to provide code generation for other tasks: JavaScript, configuration files, apache vhosts, etc.

@Ocramius
Copy link
Member

Ocramius commented Nov 22, 2022

The problem with them being aligned is that this code extends ext-reflection too, so it must stick to it to some degree, or else madness (in maintenance) ensues.

Anyway, I think DNF types are the last bit missing.

In fact: if this component encouters a DNF type at runtime, it currently crashes hard.

@arokettu
Copy link

@Ocramius thanks for the explanation

@faizan-shk
Copy link

@Ocramius any ETA when 8.2 Compatibility for laminas-code will be added. Almost all other laminas packages have added support for php 8.2!

@Ocramius
Copy link
Member

@faizan-shk the ETA is "whenever @Ocramius has a free weekend to throw a good chunk of time at this".

@Ocramius
Copy link
Member

Ocramius commented Dec 8, 2022

It is done!

@Ocramius Ocramius closed this as completed Dec 8, 2022
@driehle
Copy link

driehle commented Dec 8, 2022

Thank you, @Ocramius, for your great work! 👏

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

No branches or pull requests

9 participants