Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions docs/hot-swap.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,16 @@ dispatch the new body. The implementation is centralized in
- **The run-time cache is reset per swap.** Inline caches are scope-dependent
and sized for one specific body, so every swap installs a fresh zeroed
`ZEND_ACC_HEAP_RT_CACHE` cache that the engine (or the next swap) releases.
- **Static variables are unshared.** A closure destroys its own static table
when it dies, so the entry duplicates the defaults (`zend_array_dup`) and
lets the live per-entry table materialize lazily on the first
`ZEND_BIND_STATIC`, exactly like a plain compiled function. The class entry
is flagged with `ZEND_HAS_STATIC_IN_METHODS` so the engine's shutdown walk
releases the live table.
- **Static variables are unshared - the live table only.** The entry's
`ZEND_MAP_PTR` slot is dropped so the live per-entry table materializes
lazily on the first `ZEND_BIND_STATIC`, exactly like a plain compiled
function. The defaults table behind it stays shared and is guarded by the
body refcount alone: on PHP 8.5 no donor kind owns it
(`zend_create_closure_ex` duplicates the prototype defaults into the map
slot only), so the last body holder frees it exactly once - see
`FunctionBodySwap::unshareStaticVariables()` for the ownership rules. The
class entry is flagged with `ZEND_HAS_STATIC_IN_METHODS` so the engine's
shutdown walk releases the live table.
- **Declaration identity is preserved.** The entry keeps its name, scope,
prototype and declaration-level flags (visibility, static, final);
body-level flags (variadic, generator, return type, strict types) follow the
Expand Down
4 changes: 3 additions & 1 deletion docs/opcache-binary.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,9 @@ $report->appliedMethods; // what actually happened, per entry
a payload).
- **Strict, never silent.** Anything the port cannot handle raises
`unsupportedPayload` rather than writing a subtly corrupt binary; with every
payload shape of the 8.4 walker now ported, that guard covers the platform
payload shape of the engine's walker now ported (the PHP 8.5-only shapes -
attributed constants, closures in constant expressions - included), that
guard covers the platform
predicates above (Windows/32-bit). Global functions,
classes with constants, typed properties (union/intersection/DNF type lists
included), trait-using classes (aliases and insteadof precedences included),
Expand Down
Loading