Skip to content

ext/opcache: Do not reuse the assigned range through typed references - #24210

Open
iliaal wants to merge 1 commit into
php:masterfrom
iliaal:fix/gh24088-typed-ref-assign
Open

iliaal wants to merge 1 commit into
php:masterfrom
iliaal:fix/gh24088-typed-ref-assign

Conversation

@iliaal

@iliaal iliaal commented Oct 8, 2026

Copy link
Copy Markdown
Member

Assigning through a reference to a typed property coerces the value, but range inference copied the assigned operand's range to the result, so ($GLOBALS['real'] = 9007199254740993) & 1 with $GLOBALS['real'] bound to a float property is folded to 1 instead of 0. The range is now reused only when the target is a CV that cannot be a reference. Split out of #24110.

An assignment through a reference to a typed property coerces the value, so
its result can differ from the assigned operand, but range inference copied
the operand's range to the result. Reuse it only when the target is a CV
that cannot be a reference.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant