Category
stdlib / JIT
Problem
iterator_to_array() is VM-only (#3100 closed). ext/standard/iterator_to_array.php throws in call() for JIT. Generators and Traversable materialization are needed in JIT/AOT paths that call this builtin (e.g. spread/collection helpers).
Capability matrix: VM yes, JIT no, AOT no.
php-src reference
Repro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/jit.php -r "function gen() { yield 1; yield 2; } echo count(iterator_to_array(gen()));"'
Today: JIT failure (VM-only call() stub).
Zend: 2
VM repro (works today):
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r "function gen() { yield 1; yield 2; } echo count(iterator_to_array(gen()));"'
Scope (this repo)
| Area |
Path |
| VM (done) |
ext/standard/iterator_to_array.php |
| JIT |
Lower to generator walk or call VM helper until #3074 generator JIT lands |
| AOT |
Same; register in self-host builtin policy |
| Tests |
test/compliance/cases/stdlib/iterator_to_array_jit.phpt |
| Matrix |
capability-matrix.php |
Done when
Notes
Labels
stdlib, implementation-ready
Category
stdlib / JIT
Problem
iterator_to_array()is VM-only (#3100 closed).ext/standard/iterator_to_array.phpthrows incall()for JIT. Generators and Traversable materialization are needed in JIT/AOT paths that call this builtin (e.g. spread/collection helpers).Capability matrix: VM yes, JIT no, AOT no.
php-src reference
ext/spl/iterator.c—PHP_FUNCTION(iterator_to_array)Zend/zend_generators.cRepro
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/jit.php -r "function gen() { yield 1; yield 2; } echo count(iterator_to_array(gen()));"'Today: JIT failure (VM-only
call()stub).Zend:
2VM repro (works today):
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && php bin/vm.php -r "function gen() { yield 1; yield 2; } echo count(iterator_to_array(gen()));"'Scope (this repo)
ext/standard/iterator_to_array.phptest/compliance/cases/stdlib/iterator_to_array_jit.phptDone when
2for simple generatorpreserve_keysflag honored for keyed yields (feat(generators): SSOT VM-fallback, keyed-yield fix, JIT stub (#167) #3085 VM behavior)iterator_to_arrayNotes
Labels
stdlib,implementation-ready