I'm currently developing a Wordpress plugin. I just became aware of the fact that most major Wordpress hosting environments are still using PHP 5.2. Given the fact that security patches for 5.2 are still being released despite the fact 5.2 is no longer officially supported, it very much looks like 5.2 isn't going anywhere soon.
So it looks like I'll need to do some refactoring where I've made use of a few 5.3 features, namely late static binding and closures.
Ideally I don't want to totally trash my 5.3 environment just to install a 5.2 one. Is there some way to set a 'compatibility mode' for my 5.3 setup so it only accepts valid 5.2 syntax?
php has no backward compatibility in all version. It often removed some functions when it changed version. The problem occurs when you have to upgrade server and need to change php version but some php scripts no longer work with new php version. You also have to correct php script which is a bigger job.
Many improvements and enhancements to the filter and zip extensions. Memory limit is now always enabled, this includes Windows builds, with a default limit of 128 megabytes. Added several performance optimizations using faster Win32 APIs (this change means that PHP no longer supports Windows 98).
PHP 7 is an improved version of PHP 5 that provides faster performance while using less storage. PHP5 coding is much simpler than traditional coding, and PHP 7 provides developers with a simple coding system. The upgraded PHP7 engine is regarded as a next-generation design.
There's no way to do this, you'll have to install 5.2.
If you can live with catching only syntax level incompatibilities (static::
, lambda functions, goto
, ...), then you can have a 5.2 binary in an isolated location and run the syntax check on the files (php -l
) as a build step. You won't get warned of usage of the new functions, new arguments, etc. though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With