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
Stdlib: iterator_to_array() accepts array keys as "Array" — Zend TypeError Illegal offset type (ext/spl/iterator.c) #23573
When an iterator yields an array key (e.g. MultipleIterator with MIT_KEYS_ASSOC / MIT_KEYS_NUMERIC), Zend iterator_to_array() throws TypeError: Illegal offset type. The VM coerces the key to the string "Array" and returns a one-element array (last row only) — silent wrong result.
foreach over the same MultipleIterator correctly yields array keys on both Zend and VM; the gap is specifically materializing those keys into a PHP array.
Verified 2026-07-26 (host Zend 8.2.32 vs php bin/vm.php):
Activity
PurHur commentedon Jul 26, 2026
claim: PHP Compiler STD Lib Advanced — batch (issues #23552, #23431, #23565, #23511, #23572, #23573)
Working #23552 first (array_walk object visibility + mangling; also covers #23431 done-when). Sequential PRs; merge before next.
Stdlib: iterator_to_array() TypeError on illegal offset keys (#23573) (…
PurHur commentedon Jul 26, 2026
Merged #23617
Verification: Zend + VM issue repro both
TypeError:Illegal offset type;phpunit --filter iterator_to_array_illegal_offset_typeOK (2 tests).Fix:
appendHashTableEntryusesHashTable::normalizeIndexKeyso array/object/enum keys reject instead of coercing to"Array".