OPcache stores compiled PHP scripts in shared memory so they don't have to be compiled again on every request. It has shipped with PHP since 5.5, and almost nobody runs PHP in production without it, yet it was still optional. This RFC from Tim Düsterhus, Arnaud Le Blanc and Ilija Tovilo makes OPcache a required part of PHP, built in the same way as ext/date, ext/pcre and ext/standard.
Why change it
Because OPcache was optional, it was easy to leave it out by accident. The RFC points to the official PHP Docker image as an example, where you have to build and load OPcache yourself.
Being optional also meant PHP kept two separate code paths for core work like loading and compiling a script, one with OPcache and one without. That made OPcache-only bugs easy to miss in testing.
The main goal is simpler maintenance. The PHP team can integrate OPcache more tightly with the Zend Engine, PHP's core. The Optimizer, the part of OPcache that improves compiled code, would always be available, and core developers could remove duplicated logic from the engine.
What stays the same
OPcache is always loaded, but that doesn't mean it's always enabled. Settings like opcache.enable and opcache.enable_cli stay, and so does the list of situations where OPcache turns itself off.
The RFC also mentions that more settings may come later, such as one that lets you use the Optimizer on the command line without the cache.
What it means for existing code
Your PHP code doesn't change, but your build and config might:
- The
--disable-opcacheflag for./configureis removed. - You need to remove
zend_extension=opcachefrom yourphp.ini.
Extensions can now rely on OPcache always being loaded.
The vote
Accepted. Voting closed on June 25, 2025 with 30 in favor and none against, clearing the two-thirds majority it needed. It was implemented for PHP 8.5.