![]() For those reasons, I’ll be focusing on migrating the code to PHP8.1, and not 8.2. While PHP8.2 was released on December 8, 2022, and I encourage you to begin looking over the official 8.1 to 8.2 migration guide and begin making plans to upgrade, most of the checkers I mention in this article have not completed full support for 8.2 at this time. This means you can use PHPCodeSniffer to scan your codebase, applying the rules from PHPCompability to sniff out any incompatibilities with PHP 8.1 that might be present. PHPCompatibility “is a set of sniffs for PHP CodeSniffer that checks for PHP cross-version compatibility” allowing you to test your codebase for compatibility with different versions of PHP, including PHP 8.0 and 8.1. ![]() Luckily, you can write your own collection of sniffs to define any set of rules you like. PHPCodeSniffer ships with a collection of standards you can use including PEAR, PSR1, PSR2, PSR12, Squiz, and Zend. It checks your code against a collection of defined rules (aka “sniffs”) referred to as “standards”. PHPCodeSniffer (PCS) is a package for syntax checking of PHP Code. Luckily there are some options to help pinpoint potential problem areas in the migration. While these guides are incredibly handy, you may very well have tens of thousands of lines of code to check, some of which you may have inherited. Be sure to read through the Backward Incompatible Changes and Deprecated Features sections. Luckily, PHP provides an official migration guide from PHP 7.4 to 8.0 to get you started (and an 8.0 to 8.1 migration guide as well). But upgrading all that legacy code is daunting! Where to start? You’ll also be missing out on significant speed and performance improvements introduced in 8.0 and further improved in 8.1. In addition, you will most likely begin to encounter compatibility issues with third-party code/packages as they update their code to be compatible with later versions and drop support for 7.4. In a similar vein, finding support for issues you encounter with PHP 7.4 will become increasingly more difficult. Staying on PHP 7.4 drastically increases the risk of your site being compromised in the future. As we move farther and farther away from the EOL date, attackers will turn their focus to PHP 7.4 knowing that any vulnerabilities they discover will go unpatched in the majority of systems. ![]() The biggest are security risk and support. You could continue to remain on PHP 7.4, but there are several benefits to updating. While your PHP 7.4 code isn’t going to immediately stop working, you do need to begin making plans for the future of this codebase. ![]() If you’re like me, that date snuck up much faster than anticipated. The end-of-life (EOL) for PHP 7.4 was Monday, November 28, 2022. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |