Category
Regression: · php-src-strict · LimitIterator::seek null offset
Problem
LimitIterator::seek(null) soft-coerces on Zend with E_DEPRECATED for parameter #1 ($offset) and seeks to offset 0. VM throws TypeError: Argument #1 ($offset) must be of type int, null given.
Distinct from closed #31621 (__construct null offset/limit) and #13963 (negative seek OutOfBounds).
Probed 2026-08-16 — host Zend PHP 8.2+ vs php bin/vm.php.
| Repro |
Zend 8.2+ |
VM (2026-08-16) |
$l->seek(null) after rewind on [10,20,30] |
E_DEPRECATED … #1 ($offset) + cur=10 key=0 |
TypeError … $offset must be int |
php-src reference
PHP implementation target
ext/spl/LimitIteratorBuiltin.php (or shared SPL int soft-null helper) — null $offset → Zend E_DEPRECATED then coerce to 0 (do not TypeError)
- No new
runtime/*.c
Repro
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_limititerator_seek_null.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_limititerator_seek_null.php'
Done when
Category
Regression:· php-src-strict · LimitIterator::seek null offsetProblem
LimitIterator::seek(null)soft-coerces on Zend withE_DEPRECATEDfor parameter#1 ($offset)and seeks to offset0. VM throwsTypeError: Argument #1 ($offset) must be of type int, null given.Distinct from closed #31621 (
__constructnull offset/limit) and #13963 (negative seek OutOfBounds).Probed 2026-08-16 — host Zend PHP 8.2+ vs
php bin/vm.php.$l->seek(null)after rewind on[10,20,30]E_DEPRECATED…#1 ($offset)+cur=10 key=0TypeError…$offsetmust be intphp-src reference
ext/spl/spl_iterators.c—zim_LimitIterator_seekext/spl/spl_iterators.stub.php—seek(int $offset): voidPHP implementation target
ext/spl/LimitIteratorBuiltin.php(or shared SPL int soft-null helper) — null$offset→ ZendE_DEPRECATEDthen coerce to0(do not TypeError)runtime/*.cRepro
Done when
$offsetemitsE_DEPRECATEDciting parameter#1 ($offset)(no TypeError)0(current()===10on the fixture)