Category
Regression: · php-src-strict · RecursiveIteratorIterator soft-null mode
Problem
new RecursiveIteratorIterator(new RecursiveArrayIterator([1,[2]]), null) on Zend emits E_DEPRECATED: RecursiveIteratorIterator::__construct(): Passing null to parameter #2 ($mode) of type int is deprecated, then coerces and iterates ([2] leaves-only default). VM produces the same iteration result but omits the deprecation.
Probed 2026-08-16 — host Zend PHP 8.2+ vs php bin/vm.php.
| Repro |
Zend 8.2+ |
VM (2026-08-16) |
new RecursiveIteratorIterator(new RecursiveArrayIterator([1,[2]]), null) |
E_DEPRECATED then [2] |
[2] only (no deprecation) |
php-src reference
PHP implementation target
ext/spl/ RII ctor — shared soft-null int deprecate/coerce (same family as LimitIterator null offset); no new runtime/*.c
Repro
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_rii_null_mode_deprecated.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_rii_null_mode_deprecated.php'
Done when
Category
Regression:· php-src-strict · RecursiveIteratorIterator soft-null modeProblem
new RecursiveIteratorIterator(new RecursiveArrayIterator([1,[2]]), null)on Zend emitsE_DEPRECATED: RecursiveIteratorIterator::__construct(): Passing null to parameter #2 ($mode) of type int is deprecated, then coerces and iterates ([2]leaves-only default). VM produces the same iteration result but omits the deprecation.Probed 2026-08-16 — host Zend PHP 8.2+ vs
php bin/vm.php.new RecursiveIteratorIterator(new RecursiveArrayIterator([1,[2]]), null)[2][2]only (no deprecation)php-src reference
ext/spl/spl_iterators.c—RecursiveIteratorIterator::__constructext/spl/spl_iterators.stub.php—int $mode = RecursiveIteratorIterator::LEAVES_ONLYPHP implementation target
ext/spl/RII ctor — shared soft-null int deprecate/coerce (same family as LimitIterator null offset); no newruntime/*.cRepro
Done when
$modeemits Zend E_DEPRECATED citing parameter Php stdlib specs implementation #2 ($mode)[2]for this fixture)strict_types=1TypeError preserved