Repository navigation
Conversation
This was referenced Oct 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #24280: object
foreach ($object as &$value)currently permits acquiring references toprivate(set)andprotected(set)properties from forbidden scopes, including properties already held in a reference. Check setter visibility before exposing the reference, while retaining readonly checks and typed-reference tracking.The existing setter-access helper handles protected scopes and fake scopes. A same-class fast path avoids the helper only when EG(fake_scope) is null and the executing function belongs to the declaring class.
Candidate: cf991cb, based on PHP-8.4 f6852be. Six files: VM source, regenerated executor, three PHPTs, NEWS. No CI harness is included.
Fresh native qualification: https://github.com/Xauele/php-src/actions/runs/39931975656 (source e15cea8; identical VM and PHPT blobs to this candidate; candidate additionally has NEWS).
Tests cover fresh and retained references, forbidden global/child access, allowed owner/protected child writes, partial writes before an error, readonly/typed/dynamic/hooked properties, bound closure scopes, traits, global callees, lazy ghosts/proxies and 3000 repeated attempts.
Performance limitation: a release-build alternating A/B benchmark (20 samples per binary per case, same pinned base/configuration, interpreter, checked checksum) measured array -0.49%, stdClass +1.64%, plain declared properties +4.01%, typed +5.23%, retained references +1.97%, same-class restricted properties +6.35%. These are microbenchmark timings, not application-level estimates. The simpler helper-only variant repeatedly cost 11–12% in the last case. Raw samples are attached to the run as an artifact. The remaining cost needs maintainer assessment.
Full platform CI on this exact candidate: https://github.com/Xauele/php-src/actions/runs/39932513648 (pending). This is a draft for maintainer review, including assessment of the remaining measured hot-path overhead. Full platform CI is still pending; no merge readiness is claimed.