Category
Regression: · php-src-strict · LimitIterator soft-null ctor args
Problem
new LimitIterator(new ArrayIterator([1,2,3]), null, null) on Zend emits E_DEPRECATED for parameters #2/$offset and #3/$limit, coerces to 0, then throws OutOfBoundsException: Cannot seek to 0 which is behind offset 0 plus count 0 (limit 0). VM hard-rejects with TypeError: LimitIterator::__construct(): Argument #2 ($offset) must be of type int, null given — no soft-null path.
Not covered by #31513 (null inner iterator message citation).
Probed 2026-08-16 — host Zend PHP 8.2+ vs php bin/vm.php.
| Repro |
Zend 8.2+ |
VM (2026-08-16) |
new LimitIterator(new ArrayIterator([1,2,3]), null, null) |
E_DEPRECATED×2 then OutOfBoundsException (limit 0) |
TypeError on $offset |
php-src reference
PHP implementation target
ext/spl/LimitIteratorBuiltin.php (or shared SPL ctor coerce) — soft-null deprecate + coerce to int like Zend; then existing limit-0 seek behavior; no new runtime/*.c
Repro
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_limititerator_null_offset_limit.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_limititerator_null_offset_limit.php'
Done when
Category
Regression:· php-src-strict · LimitIterator soft-null ctor argsProblem
new LimitIterator(new ArrayIterator([1,2,3]), null, null)on Zend emits E_DEPRECATED for parameters #2/$offset and #3/$limit, coerces to 0, then throwsOutOfBoundsException: Cannot seek to 0 which is behind offset 0 plus count 0(limit 0). VM hard-rejects withTypeError: LimitIterator::__construct(): Argument #2 ($offset) must be of type int, null given— no soft-null path.Not covered by #31513 (null inner iterator message citation).
Probed 2026-08-16 — host Zend PHP 8.2+ vs
php bin/vm.php.new LimitIterator(new ArrayIterator([1,2,3]), null, null)OutOfBoundsException(limit 0)TypeErroron$offsetphp-src reference
ext/spl/spl_iterators.c—LimitIterator::__constructarg info / soft null coerceext/spl/spl_iterators.stub.php—int $offset = 0, int $count = -1PHP implementation target
ext/spl/LimitIteratorBuiltin.php(or shared SPL ctor coerce) — soft-null deprecate + coerce to int like Zend; then existing limit-0 seek behavior; no newruntime/*.cRepro
Done when
$offset/$limitemit Zend E_DEPRECATED (not TypeError) under non-strictOutOfBoundsExceptiontextstrict_types=1TypeError preserved