Skip to content

Regression: ArrayIterator::seek(null) silent — Zend E_DEPRECATED (ext/spl/spl_array.c) #31730

Description

@PurHur

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

  • VM emits Zend-matching E_DEPRECATED then seeks to 0; JIT/AOT agree if in scope
  • Compliance .phpt guard under test/compliance/cases/ (SPL / ArrayIterator)
  • php-src-strict; no php-compiler-strict shortcut

Activity

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:vmVirtual machinebugSomething 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