reactphp / reactphp

Event-driven, non-blocking I/O with PHP.

Home Page:https://reactphp.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[RFC] support PHP 7+ only

WyriHaximus opened this issue · comments

With PHP 5.6 EOL for a couple of months now and all our 1.0 releases working from PHP 5.3 (even though we strongly reccomand 7+) and upwards I think it is time to start dropping support for PHP 5 all together. This would open up to features like [] instead of array() for arrays, ::class constants, yield etc etc. And of course all the goodies PHP 7 brought, I've been using them in @php-api-clients for the past year and they work well IMHO. IMHO the question isn't whether we should do this but if we should do this in 1.1+ or in 2.0.

commented

It might be nice- given the php version disteibution- to keep 5.6 on the supported list for a while. The mentioned benefits, short arrays, yield, ::class etc should all be supported though I've seen some yield features missing. So maybe 5.6 for 1.1 and 7.0 for 2.0 might be a reasonable approach?

I'd also like suggesting to take another look at ringcentral/psr7. Afaik t main reason for its introduction has been php 5.3 support?

That would work. Or we could do something like this:

  • 1.0: PHP 5.3
  • 1.1: PHP 5.6
  • 1.2: PHP 7.0
  • 1.3: PHP 7.1

Which is allowed by semver: https://twitter.com/Ocramius/status/870002679937875968

I personally encourage every single user of this library to use PHP7+ for a various reasons (performance, security, support) 👍

That being said, how much would be gained by dropping support for older versions? Note that this is BC break which will have the effect that a non-zero number of users will not be able to upgrade anymore. This leaves us with the question which version we should upgrade to?

Our current focus is on releasing a stable v1.0.0 ASAP, so afaict there are no immediate plans to drop support for older versions any time soon. However, this is something that we may look into for a future release if it provides substantial value 👍

We could also support 5.x and 7.x simultaneously (as un-fun as that might be). While EOL is important so is usage.

Which is what we are doing now :). But looking at those graphs 5.6 and 7.x are most in use today so I wouldn't mind slowly upping the minimum requirements in composer.json to 5.6 and use the features coming with that version

Let me start with saying that we (the @reactphp team) realize that this is a sensitive (and highly political) subject. We have discussed this a number of times internally and have yet to make our future roadmap public.

First things first: I think we all agree that we highly recommend running the latest PHP versions. If active security support is not an argument for your project (hint: it probably should be!), so should be the vast performance improvements starting with PHP 7+. In the past months, we have updated our documentation to actively encourage people to update to the latest version and will continue to recommend doing so in the future.

That being said, we do understand that certain projects may have issues with updating their PHP versions for a number of reasons. While we do not encourage using outdated and unsupported PHP versions, we do not agree that excluding these versions "just for the sake" from using ReactPHP is our job (see also #350).

Again, we do actively discourage using outdated and unsupported PHP versions. However, given they do currently not limit our ability to work on ReactPHP, we see no reason to actively exclude these versions (see also #350).

This means that there are currently no plans to change our minimum required PHP version at least until we release a stable v1 of our components (#351). This also means that we will provide some (limited) long term support for legacy versions with our v1 releases in the future, so projects relying on ReactPHP do not experience any unexpected breaks. I would even go as far as to say that ReactPHP's "runs anywhere" philosophy is one of its unique selling points and part of what sets it apart from competing projects.

I believe this has been answered, so I'm closing this for now. Obviously, we may reconsider this for the changes that are planned for a future release ("beyond v1").

commented

Hello, please forgive me for continuing the issue that has ended; 4 years have passed since 8.x has been released; react is an influential project, it is responsible for promoting the coverage of the new version of PHP; 5.3 is popular 10 years ago, when i just learn php. let it pass the obsolete things

It's highly recommended to use PHP 7+ for this project

This is what most of our components include in their install instructions. Our components work just fine with PHP 8 (see test setups), but with PHP 8 being released only a couple of months ago, we're still seeing most installations from PHP 7.x. I don't think there's anything that needs to be done here?

That being said, there are plans for a future ReactPHP version that builds on top of more recent language features. This will likely drop support for some very old and outdated PHP versions, but we'll post more details on this when plans become more tangible.

commented

@clue
hi, no one doubts that reactphp is not enough to support the new version of php, it's just that reactphp needs to do something to help popularize php7/8, rather than condone the existence of antiques like 5.3.
They should have disappeared long ago like IE6. reducing support will speed up the process.

commented

Well known. No popular php library still supports 5.3 except reactphp

@slince Composer still supports it, but as @clue mentioned we are drawing up plans that also touch on this subject that will be made public soon.