DCX Technology RadarDCX Technology Radar

PHP7 over PHP5

This item was not updated in last three versions of the Radar. Should it have appeared in one of the more recent editions, there is a good chance it remains pertinent. However, if the item dates back further, its relevance may have diminished and our current evaluation could vary. Regrettably, our capacity to consistently revisit items from past Radar editions is limited.
Adopt

PHP 5 has been around for a very long time, and can be considered as the PHP version that defined where PHP wants to go in the future. With proper OOP, support for clojures and a steadily improving type system, it has become a very mature language. However, in the past 3 years, Facebook introduced HHVM, which became a major influence on PHP 7 and eventually brought a lot of improvements not only for the execution speed, but also with proper type hints and other features.

Here at DCX, we have numerous PHP projects, and we often kept it backwards-compatible to make sure that it will run on older systems. This is comparable to the procedure most frameworks (Magento, OroPlatform and derived projects) use.

Now, PHP 5 has reached its end--of-life, and it is time to discontinue the backwards-compatibility in favor of better and more stable applications. Even though we can use the PHP 7 runtime while being PHP 5-compatible, it is not considered good practice anymore, as we can now rely on the PHP 7 features and use all of its advantages.

One of the major points PHP 7 supports is proper type hinting and return types (apart from PhpDocs), which makes static analysis much easier and can improve the overall code quality significantly.