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
{{ message }}
Repository navigation
json_encode() of an ArrayObject answers {} instead of its storage's elements. #589
Known-bug repro: tests/aot/repro/wrong/json_encode_arrayobject_empty.php — bash tests/aot/xfail.sh -k json_encode_arrayobject_empty reports XFAIL while this is open and XPASS once it is fixed; then move the repro into tests/aot/cases/ and close this issue.
Root cause found during the #655 sweep (not fixed): (array) of an ArrayObject/ArrayIterator returns its internal slots (\0ArrayObject\0__s, …) instead of the storage, and json_encode goes through that cast. Two producers need the storage arm: the per-class __mir_ovars_<id>_mg helpers (EmitLlvmBuiltins::emitObjectVarsInline) and the descriptor-reached @__mir_props_<id> (the path the stdlib's json_encode takes, since the stdlib's class table never names a program's prelude classes). get_object_vars() already matches php.
Activity
blacktrs commentedon Nov 12, 2026
Root cause found during the #655 sweep (not fixed):
(array)of an ArrayObject/ArrayIterator returns its internal slots (\0ArrayObject\0__s, …) instead of the storage, andjson_encodegoes through that cast. Two producers need the storage arm: the per-class__mir_ovars_<id>_mghelpers (EmitLlvmBuiltins::emitObjectVarsInline) and the descriptor-reached@__mir_props_<id>(the path the stdlib'sjson_encodetakes, since the stdlib's class table never names a program's prelude classes).get_object_vars()already matches php.