Categories


Archives


Recent Posts


Categories


PHP 8: What you Need to Know

astorm

Frustrated by Magento? Then you’ll love Commerce Bug, the must have debugging extension for anyone using Magento. Whether you’re just starting out or you’re a seasoned pro, Commerce Bug will save you and your team hours everyday. Grab a copy and start working with Magento instead of against it.

Updated for Magento 2! No Frills Magento Layout is the only Magento front end book you'll ever need. Get your copy today!

I’m not writing much PHP these days, but my general impression is the PHP 8 release has been rough on project maintainers. I spent a bit of time this weekend catching up.

Back in the fall Platform.sh, a PHP cloud hosting company, posted a ten part series on changes coming in PHP 8.0. With the language released they’ve collected and updated these blog posts into a “free as in give us your contact information” ebook that does a good job of summarizing the changes. The book’s also for sale on LeanPub on a scale that slides to zero.

Also back in the fall, Yoast, creators of a popular WordPress SEO plugin released a report on how PHP 8’s breaking changes would effect WordPress.

Also, the official php.net website features a marketing-style landing page for PHP 8 that outlines its new features as well as the usual major version migration guide

I haven’t seen much written about this, but a lot of the JIT related internals changes have created — challenges — for APM/profiling vendors. You get a hint of this from the Blackfire.io announcement about their PHP 8 support.

Blackfire does not support the JIT option of PHP 8. Blackfire may actually crash if you enable this feature, therefore we do not recommend it. We’re working on compatibility when JIT is activated.

You also get a whiff of this from Derick Rethans’s struggles in finding the time/money to maintain xDebug — a critical piece of PHP infrastructure.

Sebastian Bergmann, author and maintainer of PHPUnit, appears to have similar concerns about how to keep his (and other) open source projects going.


For my own part a brief test of pestle threw off a few deprecation warnings

% pestle.phar
PHP Deprecated:  Required parameter $array follows optional parameter $string in phar:///Users/astorm/bin/pestle.phar/modules/pulsestorm/magento2/cli/generate/menu/module.php on line 28

Deprecated: Required parameter $array follows optional parameter $string in phar:///Users/astorm/bin/pestle.phar/modules/pulsestorm/magento2/cli/generate/menu/module.php on line 28

but nothing too bad. Also, given pestle’s primary user base is Magento 2 developers and Magento’s plans for PHP 8 are — unclear at best — I have time.

The general sell on PHP 8 has been a long overdue tightening up a lot of language quirks. Only time will tell if this is a lasting tightening up, or just swapping one set of quirks for another.

Copyright © Alan Storm 1975 – 2021 All Rights Reserved

Originally Posted: 29th December 2020