Category
Regression: · php-src-strict · SPL soft-null
Problem
ArrayIterator::seek(null) under non-strict types must emit E_DEPRECATED ("Passing null to parameter #1 ($offset) of type int is deprecated") and soft-coerce to 0 (Zend). VM seeks to 0 silently (no deprecation).
Sibling soft-null work: ArrayIterator::setFlags(null) (#31703), LimitIterator::seek(null) (#31690), DirectoryIterator::seek(null) (#31723).
Probed 2026-08-17 — host Zend PHP 8.2+ vs php bin/vm.php.
| Repro |
Zend 8.2+ |
VM (2026-08-17) |
(new ArrayIterator([10,20]))->seek(null) |
E_DEPRECATED + key/current at offset 0 |
silent + key/current at offset 0 |
php-src reference
PHP implementation target
ext/spl/ ArrayIterator::seek — soft-null int coerce + E_DEPRECATED via shared guards (VmString/int soft-null helpers already used by sibling iterators); no new runtime/*.c logic
Repro
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_arrayiterator_seek_null.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_arrayiterator_seek_null.php'
Done when
Category
Regression:· php-src-strict · SPL soft-nullProblem
ArrayIterator::seek(null)under non-strict types must emitE_DEPRECATED("Passing null to parameter #1 ($offset) of type int is deprecated") and soft-coerce to0(Zend). VM seeks to0silently (no deprecation).Sibling soft-null work:
ArrayIterator::setFlags(null)(#31703),LimitIterator::seek(null)(#31690),DirectoryIterator::seek(null)(#31723).Probed 2026-08-17 — host Zend PHP 8.2+ vs
php bin/vm.php.(new ArrayIterator([10,20]))->seek(null)E_DEPRECATED+ key/current at offset 0php-src reference
ext/spl/spl_array.c—SPL_METHOD(Array, seek)/Z_PARAM_LONGnull deprecationext/spl/spl_array.stub.php—seek(int $offset): voidPHP implementation target
ext/spl/ArrayIterator::seek— soft-null int coerce +E_DEPRECATEDvia shared guards (VmString/int soft-null helpers already used by sibling iterators); no newruntime/*.clogicRepro
Done when
E_DEPRECATEDthen seeks to 0; JIT/AOT agree if in scope.phptguard undertest/compliance/cases/(SPL / ArrayIterator)