PHP 8.4: Opcache: INI changes on how JIT is enabled


PHP 8.0 added support for Just-In-Time compilation to PHP. JIT is disabled by default, and there are two toggles, opcache.jit and opcache.jit_buffer_size that controlled the main functionality mode of PHP, and the buffer size allowed to be used by JIT.

Prior to PHP 8.4, the default INI configuration values for PHP were:


JIT is enabled by setting the opcache.jit_buffer_size INI value, which is not as intuitive because the opcache.jit toggle also accepted opcache.jit=disable value.


In PHP 8.4, the default values for the two configuration options are changed as follows. JIT continues to be disabled by default in PHP 8.4. The only difference is that the default values for INI values have changed.



Note that even with the default value changes, JIT is disabled by default.

Backward Compatibility Impact

This is a default value change, but JIT continues to be disabled by default. Applications that do not modify the default opcache.jit* configuration values will not have any impact.

PHP applications that enabled JIT exclusively with opcache.jit_buffer_size configuration value will need to enable JIT with opcache.jit=tracing because the default value of opcache.jit has changed from tracing to disable in PHP 8.4.

; Enable JIT, and set buffer size to 128 MB.

JIT In Depth
A detailed guide on optimal JIT configuration, benchmarks, and how JIT works in detail.

Related Changes

RFC Discussion Implementation