PHP 7.3, the newest update to the widespread server-side web development language, was released on Thursday, bringing with it a handful of new features, modernizations, and modest speed improvements. For programmers who gave up on PHP prior to 2015 due to performance issues and implementation frustrations, the 7.x branch brings landmark usability and speed improvements to the language, which version 7.3 refines substantially.
The largest improvements in 7.3 include support for Foreign Function Interface (FFI), allowing programmers to write inline C code inside PHP scripts. Though this feature does not presently provide the same level of performance as native PHP code, it can under certain circumstances be used to reduce the memory footprint of a given task.
PHP 7.3 also includes flexible heredoc and nowdoc syntax, now no longer requiring closing markets to be followed by a semicolon or new line. The feature proposal for this notes that the previous rigid requirements "caused them to be, in-part, eschewed by developers because their usage in code can look ugly and harm readability." The Perl Compatible Regular Expressions (PCRE) library was updated to PCRE2, as the previous 8.x branch of PCRE is limited to bug fixes only. Improved LDAP support also makes authentication easier. The full list of changes can be found in the release announcement.
SEE: Digital transformation in 2019: A business leader's guide to future challenges and opportunities (Tech Pro Research)
Linux benchmarking website Phoronix finds that the last release candidate of PHP 7.3 brings nearly 10% performance improvements over 7.2 in the popular PHPBench test suite. It is 31% faster than 7.0, and nearly three times faster than PHP 5.6.
PHP 7.3 does bring some backward incompatible changes and deprecated functions. The use of case-insensitive constraints is now deprecated, as is the use of case-insensitive constants with a case that differs from the declaration. The ext_skel utility has been redesigned with new options and now has no external dependencies. Additionally, support for BeOS was dropped in this release, if for some reason you were hosting a server on BeOS.
Developers also released the PHP 5.6.39 security update on Thursday, for deployments with dependencies on the 5.6.x branch. Support for this legacy version is ending on December 31, 2018, making the release of PHP 7.3 a good opportunity to upgrade, though major global changes between 5.x and 7.x may complicate this type of migration. (PHP 6.x was not released, due to development issues.) Likewise, support for the original PHP 7.0 branch ended on December 3, 2018, making upgrading an urgent task for application owners using that version.
Source downloads are available from php.net, though Linux users are best served by waiting on their distribution to provide updated packages. Windows users can get it from the PHP for Windows site. Upgrade notes are available on GitHub, and a full migration guide will be published on the PHP website shortly to assist developers in making their existing code compliant with PHP 7.3.
The big takeaways for tech leaders:
- PHP 7.3 allows for inlining C code, as well as making heredoc and nowdoc more flexible, among other code readability and flexibility improvements.
- PHP 7.3 is nearly 10% faster than PHP 7.2, and three times faster than PHP 5.6 — Phoronix, 2018
- Special report: A guide to data center automation (free PDF) (TechRepublic)
- Around 62 percent of all Internet sites will run an unsupported PHP version in 10 weeks (ZDNet)
- Cross-site scripting attacks: A cheat sheet (TechRepublic)
- When it comes to cloud-based PHP development, the sticking point is the debugger (ZDNet)
- WordPress 5.0 release brings brand new editor for easier page design (TechRepublic)
James Sanders is a technology writer for TechRepublic. He covers future technology, including quantum computing, AI, and 5G, in addition to security, cloud computing, open source, mobile and satellite communications, and the impact of globalization on the tech industry, with a focus on Asia.