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

Reply via email to