Has anyone started working with PHP 8 yet? Any big backwards compatibility issues?

I finally got around to upgrading to php 7! Lol better late than never.

Recommended Answers

All 2 Replies

I'd recommend staying on PHP7.4 at this stage, I found some weird things not working , for one parameterized queries on sqlite! The new features do seem to be great, rule of thumb though - wait a year or so before making a leap.

The load balancing was ran using hey and I report the numbers for throughput (req/s) and response time (ms). The app does not connect to remote services like databases.

With throughput both PHP 7.4 and 8.0 benefit significantly from enabling OPCache Preloading. On average PHP 7.4 is slightly more performant, but not by a significant margin. For throughput there seems to be no change in concurrency 10 to 100, but PHP 8.0 with JIT is curiously less performant as low concurrency but comes alive and edges past 7.4 with OPCache Preloading from at 25+ concurrency onwards.

For response times the story is similar as for throughput. Enabling OPCache Preloading yielding better results than an upgrade from PHP 7.4 to 8.0. For response times (smaller is better) PHP 8.0 is slightly better than 7.4, but not by a meaningful margin. Response time is higher at low currency, but stays consistent from 10 to 100. 8.0 with JIT is similar story: It's worst at low concurrency, but best at high load.

All in all the improvements in baseline performance for an application like Symfony is very similar between PHP 8.0 and 7.4. This is not surprising as it has been known that the JIT in PHP 8.0, that was already around in an early form for PHP 7.0, is more beneficial for calculations and other data processing tasks which are CPU bound.

Regarding performance JIT seems to be a mixed bag here, slowing down at low concurrency and providing a significant improvement to throughput over OPCache Preloading only. More investigation needed, but here the case is not clear as it could hinder performance. JIT seems like something to be considered case by case for PHP.

So for now it is safe to say you're not in a hurry to upgrade from 7.4 to 8.0 for performance reasons. You'll be better off by upgrading from PHP 7.3 to 7.4 and enabling OPCache Preloading. That's not to say that PHP 8.0 is a disappointment by any means. It's packed with new language features and important deprecations. Most importantly is good to see that there have been no performance regressions (like there was with the move from 4.4 to PHP 5.0 way back in 2004). A great start for 8.x.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.