A PHP internals mailing list discussion about a proposed RFC for OPcache Static Cache, which would add an OPcache-managed shared-memory cache for userland values and PHP static state. The RFC introduces volatile and persistent backends with new OPcache namespace functions and attributes (#[OPcache\VolatileStatic] and #[OPcache\PersistentStatic]) that allow static properties and method static variables to survive across requests. Key discussion points include API design concerns (lock symmetry, atomic decrement behavior, serialization semantics), the default-off setting and its impact on library adoption, shared-hosting tenant isolation challenges, key-space collision risks between libraries, and development-mode behavior. The RFC author (Go Kudo) updated the proposal to address several concrete issues including adding unlock functions, lease-based lock expiry, a typed StaticCacheInfo return object, and per-entry deletion support.

2h 35m read timeFrom externals.io
Post cover image
Table of contents
The resulting public APISAPI availability: the unsafe flag is gone, opt-in insteadAPI shape: remember()References and the silent fallbackScalars and arrays-of-scalars onlyDropping pinned (and the attributes)Where this leaves usJakub: the FPM pool boundary is preservedTimo: thanks for the immutable_cache pointer
92 Impressions