Skip to content

Minimum PHP version #101

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

Closed
dshanske opened this issue May 17, 2016 · 17 comments
Closed

Minimum PHP version #101

dshanske opened this issue May 17, 2016 · 17 comments

Comments

@dshanske
Copy link
Member

Discovered today that php-mf2 has code that requires a minimum version of PHP 5.4. Suggesting we keep to a minimum of 5.3 due the 30% still using it. Going to 5.2 would be impossible due namespaces.

@jkphl
Copy link
Contributor

jkphl commented May 17, 2016

@dshanske Just out of curiosity: Where did you get that 30% number from? Would be interesting to have these insights!

(My personal opinion regarding your suggestion: Even PHP 5.5 has almost reached end of life status. I wouldn't bother supporting 5.3 anymore ...)

@aaronpk
Copy link
Member

aaronpk commented May 17, 2016

PHP 5.3 was declared unsupported in August 2014. Version 5.4 is now also unsupported, but that is more recent. http://php.net/eol.php

In another thread, we decided to drop support for 5.3 because of how old it is: #35

@aaronpk
Copy link
Member

aaronpk commented May 17, 2016

Here's a table showing the supported and EOL versions of PHP from http://php.net/supported-versions.php

screenshot 2016-05-17 07 56 16

@dshanske
Copy link
Member Author

Either way, this is about using short array syntax. I know about the parse_url issue and have a workaround for it.

@dshanske
Copy link
Member Author

WordPress, by the way, estimates 20% of its installs are on 5.3

@dshanske
Copy link
Member Author

Maybe I should just scope it to short array syntax. Also, anyone know a good program to check PHP for version compatibility?

@barnabywalters
Copy link
Collaborator

As of v0.3.0, php-mf2 requires PHP 5.4, which (as Aaron pointed out) is also already at EOL. All previous versions of php-mf2 work with PHP 5.3 and are still available for people who desperately need to use ancient versions of PHP for whatever reason. Further development will continue to support PHP 5.4.

@aaronpk
Copy link
Member

aaronpk commented May 17, 2016

Here's the stats from Wordpress: https://wordpress.org/about/stats/

That's unfortunately a pretty large percentage on 5.3 and 5.2. I am reluctant to add back support for 5.3, since I really don't want to encourage/support people using a version of PHP that's that old. However, if the only change needed to support 5.3 is to use the expanded array syntax, I would be open to a PR with that. Thoughts, @barnabywalters?

@dshanske
Copy link
Member Author

My request is to support compatibility when possible with earlier versions. Like in this example. I found something for PHP Sniffer that would identify things like this do we can see what the scope is.

@gRegorLove
Copy link
Member

Looking through Parser.php, I think there's only one location using short array syntax. I think making it the longer syntax is fine for backcompat, but I think composer.json should still require 5.4+.

@aaronpk
Copy link
Member

aaronpk commented May 17, 2016

That sounds like a reasonable compromise. I assume the file is copypasta into Wordpress rather than loaded by Composer?

@dshanske
Copy link
Member Author

At the moment,yes.

@dshanske
Copy link
Member Author

I did a check. If I manually change that line to use the old syntax, it will work again under 5.3. So, should we prepare the PR?

@aaronpk
Copy link
Member

aaronpk commented May 18, 2016

Yeah, if it's really just that one line then that's simple enough. Thanks for checking it out!

@dshanske
Copy link
Member Author

https://github.com/wimg/PHPCompatibility - I've added this, which can check compatibility at various versions to try and check for compatibility before deploying anything in the future.

@voxpelli
Copy link
Contributor

I don't think we should put too much weight on those stats. Have anyone actually complained about lack of PHP 5.3 support? My guess is that those 5.3 blogs are not very actively maintained and thus fairly unlikely to install a new plugin like the IndieWeb ones and if they are actively enough maintained to actually install new plugins then they should primarily ensure they move to a more modern PHP version, not install additional plugins.

I would rather considering dropping 5.4 support to ensure newer features can be used + lessen the risk for unintentional compatibility breaking changes which are becoming increasingly likely as PHP-devs move further and further away from such old versions and adopt practices that doesn't work with such old versions.

@pfefferle
Copy link

pfefferle commented May 18, 2016

@voxpelli : @dshanske reported this, because he gets bug reports from users of his plugin that ran into PHP 5.4 "issues".

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

7 participants