Is anyone still using PHP < 5.6?

Your PHP version


  • Total voters
    45

Arty

Well-known member
I'm working on some code for my future XenForo 2 add-ons, recently noticed that some of my code won't work with PHP below 5.6 because I'm using class constants with arrays. So I'm thinking if I should change code to allow older versions or keep it as is.

Is anyone still running PHP below 5.6 on their servers?
 

Snog

Well-known member
There are two trains of thought on this.

Personally I code for the minimum requirements for XenForo, in the case of 2.0 it's currently PHP 5.4. That allows everyone with XF to use the add-on.

The other is to put a minimum requirement on your add-on and that would be PHP 5.6. This could limit who can use your add-on.
 

Chris D

XenForo developer
Staff member
There are two trains of thought on this.

Personally I code for the minimum requirements for XenForo, in the case of 2.0 it's currently PHP 5.4. That allows everyone with XF to use the add-on.

The other is to put a minimum requirement on your add-on and that would be PHP 5.6. This could limit who can use your add-on.
Both are good tactics but of course the latter may reduce who can use the add on.

We have a system in XF2 which can block an add on install if the requirements aren't met so at least you can enforce a minimum PHP version without having to write any code to do it.
 

Mouth

Well-known member
php < 5.6 is now EOL and not even security supported. php 5.6 has now finished active development. If I was a developer, I'd only support versions that are themselves actively supported.
IMHO, XF 2.0 shouldn't support, or constrain developers, to end of life php versions that are no longer even supported at all.
 

CarpCharacin

Well-known member
I am using php 7.1. I don't think that you should worry about supporting ancient php versions. Only worry about supporting supported php versions, so I think that you should keep the code as is.
 

TLDR

Active member
php < 5.6 is now EOL and not even security supported
Well, there are some Linux Distros which still are supported shipping with older versions. Their developers are backporting security-related patches, so you are good to go then too.

Ubuntu 12.04 LTS for example is still supported and comes with php 5.3.10.
Debian Wheezy is still supported and ships with php 5.4.4

However, it's a good idea to use a more current version because of performance improvements, but this statement is not always true though.
 
Top