A PHP internals mailing list thread discussing a new RFC proposing OPcache Static Cache — an OPcache-managed shared-memory cache for userland values and PHP static state. The RFC introduces volatile and persistent backends with new INI directives, OPcache namespace functions, and two 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, status API returning objects vs arrays), the default-off setting and its impact on library adoption, shared-hosting tenant isolation challenges, key-space collision risks between libraries, and serialization behavior. The RFC author (Go Kudo) responded with several API updates including explicit unlock functions, lease-based lock expiry, and granular cache entry deletion.

44m read timeFrom externals.io
Post cover image
1.6K Impressions