-
-
Notifications
You must be signed in to change notification settings - Fork 155
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
Decide which PHP versions to support #500
Comments
with stdlib you mean php-src or some other php based dependency?
maybe it would make sense to publish different safe versions, which indicates the min php version? like or alternatively keep |
//cc @OskarStark @silasjoisten opinions? |
As an application developer, I want my application to support a range of both current-and-future PHP versions -- I wonder if composer has sufficient magic so that the app dev can
My gut was thinking in this direction - so an application developer who wants to support "php81 or newer" can depend on "tcm/safe 3.x or newer"... except I think composer will refuse to install 4.x when asked for "3.x or newer", as that's considered a breaking change? I have no good answers here D: Separate from the problem of "how do we support multiple versions", there's also a question of "which versions to support" -- for that, my gut tells me that since the current release is so old, we should do one more release which supports 8.1-8.4, then create a branch from there which will continue to support 8.1 with security-fixes-only for as long as php 8.1 itself receives security fixes -- and then going forwards we only officially support "actively maintained" versions of php ( https://endoflife.date/php ) |
An alternative approach which seems like implementation hell, and I don't want to do this, just throwing it out there as an option:
if (PHP_VERSION >= 8.0 && PHP_VERSION < 8.2) {
function ftp_alloc(resource $connection) {...}
} elseif(PHP_VERSION > 8.2) {
function ftp_alloc(FTP\Connection $connection) {...}
} though even this doesn't guarantee compatibility (Like I think |
If a PHP version is in security only, drop it here and increase. They can still use the versions which are available, to get new features, upgrade, same for the other packages and frameworks.we don't have the man power to maintain many version or packages. |
I agree we should only support PHP Versions which are maintained and not security only. |
if we drop PHP8.1 we will loose ubuntu22 LTS, which I think is a problem. |
We kind-of already don't support 8.1, because the API has drifted to be incompatible - we claim to support it, but the code is merely 8.1-compatible on a surface syntax level, and it works-by-coincidence in most-but-not-all cases (ie, it works for functions whose APIs haven't changed at all) AFAIK the PHP documentation only covers "the current version" - so my suspicion is that to properly support anything other than "the current version", we'll need to use git history to rewind the documentation back to that old version, run the generator script, and release something like I think our options are either:
|
Perhaps, if we're willing to slightly abuse semver:
(... buuuuut I think that still doesn't work with composer.lock files? Again throwing out ideas without really knowing what's best, hoping that it inspires somebody to have a brainwave :S) |
Not a problem for me, they can stick to the current version 🤷♂️ |
Thinking out loud some more, I think given So a proposal:
Bonus things for consideration:
|
Does it has to do with deprecation warnings in PHP 8.4? Deprecation Notice: Safe\gmdate(): Implicitly marking parameter $timestamp as nullable is deprecated, the explicit nullable type must be used instead in /var/www/app/vendor/thecodingmachine/safe/deprecated/datetime.php:24 |
No, that is unrelated (We already support new versions of PHP (the code in the master branch has already fixed the issue you mention) - the question being discussed in this thread (which we need to find an answer for before we can publish a new release with the php8.4 fixes) is which old versions are we able and willing to support) |
Why not different files? One for 8.0, 8.1, 8.2, 8.3, 8.4 etc. Sure, bundle size may increase but that isn't really a problem. And that way |
I'm sure I had a reason why that would be a major pain too - but then I forgot the reason, and I tried it out as a proof-of-concept, and I've now half-implemented that approach and I haven't run into any major problems yet 🤔 One thing which could be an issue with any kind of "rewind the git history of the documentation back to a few years ago and generate based on that" is that currently-fixed documentation bugs will be re-introduced. I think the worst case there is that we end up having a fork of the PHP docs where we have |
@shish could you open a PR so we can have a look at the generated files? |
The PHP standard library is constantly changing, and our generated code changes with it, which means that we naturally get out-of-sync with older php versions; this happens in both subtle and not-subtle ways, eg
resource
in php 8.1 and anFTP\Connection
in 8.2+ -- because we're based on the current docs, we generate code that says "we need anFTP\Connection
" -- so this function will crash with a type incompatibility if anybody tried to run it on 8.1resource|FTP\Connection
as input. Going through not just the current docs but also historic versions of docs to see which functions changed parameter types, and manually supporting all of those, seems like a nightmare which would inevitably fail due to human error.true
, which php 8.1 treats as a syntax errortrue
withbool
Given that supporting a wider range of versions becomes exponentially harder, what range do we want to support?
The text was updated successfully, but these errors were encountered: