PHP 8.0 feature focus: Just-in-Time compilation
Blog post from Upsun
PHP 8.0 introduces a Just-in-Time (JIT) compiler, marking a significant advancement in the language's performance capabilities. The JIT compiler translates PHP's intermediary language into machine code on-the-fly, optimizing execution speed by selectively compiling code segments that promise the greatest performance improvement. Unlike traditional interpreted languages, the JIT can enhance performance, although its benefits are more pronounced in long-running, CPU-intensive applications rather than typical web applications, which tend to involve significant I/O operations where JIT cannot contribute. While benchmarks show only marginal performance gains for standard PHP web applications, the JIT opens new possibilities for PHP in fields like persistent daemons, parsers, and machine learning, potentially making it competitive with traditionally faster languages in these areas. The development of the JIT, part of a broader initiative to transform PHP from a web-centric language to a high-performance general server language, involved substantial contributions from developers Dmitry Stogov and Zeev Suraski.