A PHP internals RFC discussion proposes adding an OPcache-managed shared-memory cache called OPcache Static Cache. The feature introduces volatile and persistent backends with explicit functions (volatile_*/persistent_*) and two PHP attributes (#[OPcache\VolatileStatic] and #[OPcache\PersistentStatic]) that allow static properties and method static variables to survive across requests. The RFC includes benchmarks against APCu on php-fpm and FrankenPHP. Key discussion points include: the feature defaulting to off due to shared-hosting tenant isolation concerns, API design issues around lock symmetry and atomic decrement behavior, serialization semantics, key-space collision risks between libraries, and the development experience. The RFC author (Go Kudo) updated the proposal to address several concrete API issues raised by Larry Garfield, including adding unlock functions, lease values for locks, a typed StaticCacheInfo return object, and per-entry cache deletion.

2h 33m 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
113 Impressions