Skip to content

Regression: AOT ArrayObject::getIteratorClass()/getIterator() aborts — VM/JIT match Zend (re-#18185, ext/spl/spl_array.c) #27567

Closed

Description

@PurHur

Category

Regression · php-src-strict · AOT

Problem

new ArrayObject($arr, 0, MyIter::class) must report getIteratorClass() === MyIter and getIterator() must return a MyIter instance. Zend/VM/JIT print gic=MyIter / cls=MyIter and iterate; AOT prints empty gic= then aborts (SIGABRT, exit 134). Prior closed issues (#18185 / #10639) fixed VM — AOT still broken. Verified @ 0392e7d24 (2026-08-04).

Repro Zend 8.2.32 VM/JIT AOT (0392e7d24)
ctor iterator class + getIteratorClass / getIterator / foreach gic=MyIter cls=MyIter 0=1 1=2 same gic= then abort exit 134

php-src reference

PHP implementation target

Repro

./script/docker-exec.sh -- bash -lc 'cat > /tmp/ao_gic_aot.php <<'\''PHP'\''
<?php
class MyIter extends ArrayIterator {}
$a = new ArrayObject([1,2], 0, MyIter::class);
echo "gic=", $a->getIteratorClass(), PHP_EOL;
$it = $a->getIterator();
echo "cls=", get_class($it), PHP_EOL;
foreach ($it as $k => $v) { echo "$k=$v "; }
echo PHP_EOL;
PHP
php /tmp/ao_gic_aot.php
php bin/vm.php /tmp/ao_gic_aot.php
php bin/jit.php /tmp/ao_gic_aot.php
php bin/compile.php /tmp/ao_gic_aot.php -o /tmp/ao_gic_aot && /tmp/ao_gic_aot'

Done when

  • AOT prints gic=MyIter / cls=MyIter / 0=1 1=2 matching Zend/VM/JIT (no abort)
  • Compliance .phpt guard under test/compliance/cases/ (spl/arrayobject_iterator_class)
  • php-src-strict; no php-compiler-strict shortcut

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Aug 4, 2026
  2. PurHur commented on Aug 5, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib Advanced — batch (#27313 #27259 #27421 #27422 #27312 #27567) — starting #27313 (RegexIterator empty AOT)

  3. PurHur commented on Aug 5, 2026

    @PurHur
    OwnerAuthor

    Batch handoff (PHP Compiler STD Lib Advanced): #27313 #27259 #27421 merged this run.

    Still queued from claim: #27422 GlobIterator, #27312 AppendIterator, #27567 ArrayObject — pick up next with fresh claim: after pulling master.

  4. PurHur commented on Aug 5, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib Advanced — batch (#27422 #27312 #27567 #27311 #27257 #27572) — queued after #27422/#27312

  5. PurHur commented on Aug 5, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib Advanced — starting #27567 after #27422+#27312 merged

  6. PurHur commented on Aug 5, 2026

    @PurHur
    OwnerAuthor

    Merged — AOT ArrayObject getIteratorClass/getIterator now match Zend/VM (gic=MyIter / cls=MyIter / 0=1 1=2).

    Batch complete this run: #27422, #27312, #27567 merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions