-
Notifications
You must be signed in to change notification settings - Fork 196
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
Any Plan to make compatible with PHP 8.4 ? #446
Comments
I don't think so. Simply: too many "strict type" changes to function interfaces. Imo we will need new fork to keep 8.2+ compatibility. |
--> Please do. So, we will make our application compatible with php 8.4 |
Feel free to fork :) |
Have you an example for it? I am testing OpenMage with php8.4 and dont see any problems (only #442) |
Maybe it depends on your definition of "compatible". Until 9.0 comes along, actual breaking changes to the language are going to be minor, so code that runs fine on 8.0 should need little if any changes to run on 8.4 (and 8.5, if that's what comes next year). For those of us using the repo to keep old projects on life support until they're retired or replaced, that's what matters. I'm not sure what "strict type changes" you're talking about exactly, but I'm guessing it's that you're seeing new deprecations and warnings, and only considering something "compatible" if it runs without any of those? Ultimately, that's about making the library ready for 9.0 - and I agree, that will be a bigger task. I don't really see what creating a new fork has to do with anything, though; if someone's willing to put in the work, why would this not be the right repo to publish it to, just as it was for 7.0 and 8.0? |
@IMSoP actually the response is in your question. "should need little if any changes" - that's the point, you have to adjust your code to run project. Just because someone on the PHP side has passion to introduce more and more strict type-ing. I have plenty of work, not really happy about fixing the working code just because underlying framework has changed. This discussion is running here for a while. For now, we decided to keep compatibility between 7.1 to 8.1. And then, there is this topic about 8.2+ support. Not resolved yet. One idea is to create either new fork, or new version. But both will generate more work, because you have to handle both version and so. |
@develart-projects I think we're still talking about different meanings of "support". I'm talking about "the minimum changes needed to run an application in production, without fatal errors or unexpected behaviour". Here is the list of breaking changes for upgrading from PHP 8.1 to PHP 8.2, and here is the list for PHP 8.3. Is there anything on either of those lists which has not been resolved in this repository? If not, I consider the repository to be "compatible with" PHP 8.2 and PHP 8.3. The list for 8.4 will be similar, because the official policy is that breaking changes should only happen in major versions - i.e. the next significant breaking changes will be in PHP 9.0. If there is a specific change which you think is blocking this repository from supporting newer versions, I would be interested to understand more clearly.
Presumably you mean clearing the deprecations and warnings introduced in 8.2 and later? I would consider that "9.0 support" - those changes will make no difference to how your application behaves under PHP 8.2, only how it will behave once PHP 9.0 comes out (or possibly even later). Most of those are just tidying up things that were always arguably bugs, PHP is just making them more obvious. It might well require a lot of effort and testing to fix them correctly, but if someone is willing to do that work, there's unlikely to be a need for a separate fork or branch - the fixed code will work just fine on a wide range of PHP versions. For instance, passing null to functions where strings are expected can often be resolved by using the null coalesce operator ( |
FWIW, I'm running a couple of projects in production on 8.3 with the latest ZF1 version and have not encountered any problems. Of course I don't use every class in the framework, but I don't think it will take much effort to continue support until 9.0. I'm willing to contribute to that effort wherever possible. |
@IMSoP I'm OK with any non-breaking change, therefore I always review the PR itself. If it's not trying to enforce new function signature or any strict output, I'm considering that as "safe" change to merge (without affecting existing code). So if you send any PR, I'm happy to review. |
@rruchte 8.2 examle: The following methods now enforce their signature:
Not sure if any of those are used by ZF library, just an example of the breaking change in the 8.2. |
Well, that's easily discovered.
A 30-second glance at those two files shows that there is no mention of any of the changed functions. Let's look at the rest of the 8.2 breaking changes:
That's it. So, we can conclude that the only possible problems someone might see are:
We could spend a little bit longer looking at those uses; or we could conclude that both are pretty unlikely, and the library already supports PHP 8.2. |
@IMSoP thanks for the analysis. Anyway, your reply is not contradicting anything I wrote in my last reply. All these are potential breaking changes and if someone drop an PR and we will exclude any backward compatibility issues, I'm happy to merge. Here is an example of the PR, causing breaking changes, because of deprecation messages: https://github.com/Shardj/zf1-future/pull/397/files I refused to merge, because of what I already explained. Considering all potential consequences case-by-case. |
All of what are potential breaking changes? What PR are you waiting for? I went through every single change in the changelog and explained why no change is needed to the library for any of them. The point I was trying to illustrate was that "supporting PHP 8.x" mostly means "reading through a small checklist, making sure none of the rare edge cases happen to affect this library". It took me 30 minutes; maybe we could spend another hour or two to be really sure. There's a vast ocean of difference between that and "we will need new fork to keep 8.2+ compatibility".
This is an example of a change which will be needed for PHP 9.0, at the earliest. Until then, it is a nice to have, and I totally understand your choice to favour extending support for 7.1 over early support for 9.0. |
Is there a possibility to leverage LLM to help rewrite some of the code? The prompt may be to “Make library compatible to PHP 8.4” I never tried it myself, but it seems like a good use case for AI. |
@woranl If significant changes are needed, there's some better tools out there than random word generators, notably Rector. The bigger challenge is how far the library can be updated without dropping support for older versions of PHP, and without requiring users to adjust their applications as well. But just to reiterate there will probably be no changes needed to this library to run under PHP 8.4. There may be an increase in deprecation notices and warnings, but these do not indicate required changes. When PHP 9.0 comes along, there will be tougher choices to make, but that's likely to be at least two years away. |
To move things forward, I have opened issues with checklists for PHP 8.2 and 8.3 compatibility: #449 and #450 The 8.2 list is mostly already checked, per my comment above; the 8.3 list I've glanced at some very easy checks, the rest is mostly just searching the code for relevant function calls. Once PHP 8.4, comes out, we can raise a similar list based on the final list of changes in that. |
Any Plan to make compatible with PHP 8.4 ?
The text was updated successfully, but these errors were encountered: