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,

I plan to open voting on the OPcache Static Cache RFC no earlier than
2026-06-04 00:00 UTC, unless new relevant and substantive issues are
raised before then.

RFC:
https://wiki.php.net/rfc/opcache_static_cache

Discussion thread:
https://externals.io/message/130912

The RFC is currently at version 1.3.0. Since the initial announcement,
the main changes are:

- the strict non-evictable backend has been renamed from "persistent" to
  "pinned", including the API, attribute, INI directive, and status names;
- both backends now default to 8 MiB, with 0 as the explicit opt-out value;
- explicit cache operation failures now return false by default, with
  $throw_on_error = true available to throw OPcache\StaticCacheException;
- the lock APIs now have explicit unlock functions and optional leases;
- status APIs now return OPcache\StaticCacheInfo objects, with
  StaticCacheInfo::$available documented as the recommended usability check;
- attribute-backed entries can be deleted by loaded class name or by
  documented exact static-state keys;
- serialization-hook behavior, development-mode behavior, CLI usefulness,
  and the shared-hosting / trust-domain model have been clarified.

The proposed vote consists of four primary votes, each requiring a 2/3
majority:

- Add the explicit volatile cache API, OPcache\volatile_*.
- Add the explicit pinned cache API, OPcache\pinned_*.
- Add the #[OPcache\VolatileStatic] attribute.
- Add the #[OPcache\PinnedStatic] attribute.

I would especially appreciate final review from people familiar with
OPcache,
the VM, and JIT-related code paths before voting opens. The areas where
focused feedback would still be most useful are:

- the shared-memory lifetime and trust-domain model;
- request-local lookup/prototype behavior and shared-graph pinning;
- value preparation and fetch reconstruction outside cache locks;
- static-property and method-static restore/publication semantics;
- tracked array/object mutation hooks;
- the JIT static-property access changes.

If there are any API, semantic, security, or implementation concerns that
should prevent the vote from opening, please raise them in this thread
before
the planned voting time.

Best regards,
Go Kudo

Reply via email to