You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vm: lower $obj->$x = v / $obj->{$x} = v to OP_OBJECT_DYN_SET
Adds OP_OBJECT_DYN_SET handling the dynamic-name property write
shape that was previously generic-AST-delegated via OpClassConst.
Stack: [receiver, name, value] → optionally push value back.
A bit 0 = keep-value-on-stack (expr context).
Handler validates the receiver is a ZObjectAccess (throwing
"Attempt to assign property \"NAME\" on TYPE" otherwise) and
dispatches through objI.ObjectSet — which already covers typed
properties, hooks, asymmetric visibility, etc.
emitObjectVarAssign routes runObjectVar with $-prefixed name
(\$obj->\$x = v) through the new opcode; a new
emitObjectDynVarAssign handles runObjectDynVar
(\$obj->{\$x} = v). Receiver-warn semantics match the AST
runners — runObjectVar suppresses the undefined-variable warning
via OpLoadLocal, runObjectDynVar does not (emitExpr → normal warn).
Also brings the dyn-form error message in line with real PHP:
"Attempt to assign property \"foo\" on int" (the AST runner was
omitting the property name).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
0 commit comments