Skip to content

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

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

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

Conversation

@iliaal

@iliaal iliaal commented Oct 8, 2026

Copy link
Copy Markdown
Owner

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 php#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.
@iliaal

iliaal commented Oct 8, 2026

Copy link
Copy Markdown
Owner Author

Submitted upstream as php#24210.

@iliaal iliaal closed this Oct 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant