Why you should upgrade your website’s PHP version today!

PHP is now on version 7.3 with 7.4 coming around the corner in November of 2019. 7.0 has been the shining light that kept PHP alive. Several alternatives threatened to make PHP 5.6 obsolete and with version 6 being skipped these alternatives almost did. But PHP came back strong with version 7. Improving virtually every aspect of PHP. Now with regular updates 7.3 is incredibly stable, fast, and safe. In some cases over twice as fast as PHP 5 versions. As you can see listed here, PHP goes back to 2015 now! If you are still on PHP5 you can be going back as far as 2004! Using PHP5 vs PHP7 is like using Windows 98 vs Windows 10 or you can say a Side Kick vs. an IPhone. I know some scripts still use PHP5 which is crazy. Still I would consider a rebuild, this type of site is not safe, slow, and will probably have errors. If the script needs PHP5 that means they are not updating it correctly so it’s not made well too.

  • 7.0 3 December 2015 3 December 2018
  • 7.1 1 December 2016 1 December 2019
  • 7.2 30 November 2017 30 November 2020
  • 7.3 6 December 2018 6 December 2021
  • 7.4 Coming in November 2019

The foundation of PHP 7 is a PHP branch that was originally dubbed PHP next generation (phpng). It was authored by Dmitry Stogov, Xinchen Hui and Nikita Popov, and aimed to optimize PHP performance by refactoring the Zend Engine while retaining near-complete language compatibility. As of 14 July 2014, WordPress-based benchmarks, which served as the main benchmark suite for the phpng project, showed an almost 100% increase in performance. Changes from phpng are also expected to make it easier to improve performance in the future, as more compact data structures and other changes are seen as better suited for a successful migration to a just-in-time (JIT) compiler. Because of the significant changes, the reworked Zend Engine is called Zend Engine 3, succeeding Zend Engine 2 used in PHP 5.

Because of major internal changes in phpng it must receive a new major version number of PHP, rather than a minor PHP 5 release, according to PHP’s release process. Major versions of PHP are allowed to break backward-compatibility of code and therefore PHP 7 presented an opportunity for other improvements beyond phpng that require backward-compatibility breaks. In particular, it involved the following changes:

  • Many fatal- or recoverable-level legacy PHP error mechanisms were replaced with modern object-oriented exceptions
  • The syntax for variable dereferencing was reworked to be internally more consistent and complete, allowing the use of the operators ->, [], (),{}, and ::, with arbitrary meaningful left-side expressions[55]
  • Support for legacy PHP 4-style constructor methods was deprecated
  • The behavior of the foreach statement was changed to be more predictable
  • Constructors for the few classes built-in to PHP which returned null upon failure were changed to throw an exception instead, for consistency
  • Several unmaintained or deprecated server application programming interfaces (SAPIs) and extensions were removed from the PHP core, most notably the legacy mysql extension
  • The behavior of the list() operator was changed to remove support for strings
  • Support was removed for legacy ASP-style delimiters <% and %> and <script language=”php”> … </script>
  • An oversight allowing a switch statement to have multiple default clauses was fixed
  • Support for hexadecimal number support in some implicit conversions from strings to number types was removed
  • The left-shift and right-shift operators were changed to behave more consistently across platforms
  • Conversions between integers and floating point numbers were tightened and implemented more consistently across platforms
  • PHP 7 also included new language features. Most notably, it introduces return type declarations for functions[66] which complement the existing parameter type declarations, and support for the scalar types (integer, float, string, and boolean) in parameter and return type declarations.

How can you check if your script / app / website works with a newer version of PHP?

multi php tool

Web Host Pro makes this incredibly easy. Our multiPHP tool in cPanel allows you to change PHP versions on the fly so you can find the newest PHP version that will work on your website. Keep in mind that once you change a PHP version, it takes about two minutes to update. We suggest after a couple minutes of trying a new PHP version you do a (hold control key and click refresh) on your browser. This hard browser refresh will check for a new web page to so you can see if the new PHP version works. In my experience, if one page works with the new version of PHP all the pages will work. It’s always good to check the other main pages as well though just to be safe.

The newer the PHP version you can get to work, the better! And you can always lower your PHP version anytime.