July 2026
Intermediate
478 pages
9h 8m
English
In this chapter, we'll show you how to leverage PHP 8's high-performance features through practical recipes. You'll learn how to effectively use Generators to vastly reduce memory usage when processing large data sets, such as multi-gigabyte files. Another recipe demonstrates how to use the SPL's RecursiveDirectoryIterator and related classes to traverse directory trees. In the last two recipes you'll discover how to implement OPcache to bypass script interpretation overhead by caching byte code, and use PHP 8's Just-In-Time (JIT) compiler to generate and cache machine code. Using code that generates a Mandelbrot set, you'll see how OPcache and JIT can produce up to a 70% reduction in execution time.
Read now
Unlock full access