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
Zend accepts argument unpacking (...$values) on builtins whose first parameter is a by-reference array (array_push, array_unshift, array_multisort). Our VM aborts with an internal Refcount is > 1, but was asserted to be 1 instead of mutating the array or completing the sort.
This is a variadic unpack + by-ref slot bug in shared call lowering, not a missing builtin implementation.
Fix: COW-separate by-ref array zvals for internal builtins in lib/VM.php::resolveOutgoingCallArgs() (separateInternalByRefArgsForWrite) before handlers mutate shared HashTables after call-time unpack expansion.
Activity
PurHur commentedon Jun 8, 2026
claim: worker-lane-c — starting this run
Fix array_push/unshift call-time unpack refcount fatal (#6689). (#7602)
PurHur commentedon Jun 8, 2026
Merged via #7602
Fix: COW-separate by-ref array zvals for internal builtins in
lib/VM.php::resolveOutgoingCallArgs()(separateInternalByRefArgsForWrite) before handlers mutate shared HashTables after call-time unpack expansion.Verification:
```bash
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh
php bin/vm.php test/repro/array_push_unshift_unpack_refcnt.php
php bin/vm.php test/repro/array_multisort_unpack_refcnt.php
vendor/bin/phpunit test/compliance/VMTest.php --filter "array_push_unpack|array_unshift_unpack|array_multisort_unpack|array_push_empty_spread|stdlib/array_push""
'
```
→ push/unshift unpack repro green; compliance OK (5 tests).