2026年5月17日(日) 0:19 Go Kudo <[email protected]>: > Hi internals, > > I'd like to start the discussion for a new RFC, OPcache Static Cache. > > RFC: https://wiki.php.net/rfc/opcache_static_cache > Implementation: https://github.com/php/php-src/pull/22052 > > The proposal adds an OPcache-managed shared-memory cache for explicit > userland values and for selected PHP static state. It introduces explicit > functions under the OPcache namespace (volatile_* and persistent_*) and two > attributes, #[OPcache\VolatileStatic] and #[OPcache\PersistentStatic], that > let selected static properties and method static variables survive across > requests. The feature is disabled by default and only activates once memory > is allocated through the new INI directives. > > The RFC covers the motivation, the deliberate split between the two > backends, the trust model (one PHP runtime = one trust domain; this is not > a tenant isolation boundary), and benchmarks against APCu on NTS php-fpm > and ZTS FrankenPHP. The PR is the full implementation, with PHPT coverage > summarized in the Validation section. > > One thing to flag on the implementation status: the Windows build is > currently broken. I don't have a Windows development environment available > yet — one is being arranged through work, and I'll get the Windows side > fixed once that's in place. > > Feedback welcome. > > Best Regards, > Go Kudo >
Hi internals, A couple of updates on this one. Most of Larry's feedback from earlier in the thread is now folded into v1.2.1: unlock/lease API, StaticCacheInfo as a readonly object, atomic_decrement creating missing keys, per-class and per-key attribute deletion, plus __serialize/__unserialize and reboot-purge documentation, among other things. Larry - if anything in there still feels off, I'd rather know now than later, so please say so. Two practical updates since v1.1 went out: The Windows build is now working (the original mail flagged it as broken; that's resolved). CI is green across the board. I'd also really appreciate a broader review at this point. The RFC is fairly large and touches OPcache internals, the VM, and JIT-adjacent paths, so independent eyes - on the API shape, the trust-model / default-off question, the static-attribute semantics, the implementation, anything at all - would be genuinely valuable. RFC: https://wiki.php.net/rfc/opcache_static_cache Implementation: https://github.com/php/php-src/pull/22052 Thanks! Best regards, Go Kudo
