Skip to content

SPL: ArrayIterator::seek(null) soft-null E_DEPRECATED (#31730) - #31736

Merged
PurHur merged 1 commit into
masterfrom
fix/31730-arrayiterator-seek-null
Aug 17, 2026
Merged

SPL: ArrayIterator::seek(null) soft-null E_DEPRECATED (#31730)#31736
PurHur merged 1 commit into
masterfrom
fix/31730-arrayiterator-seek-null

Conversation

@PurHur

@PurHur PurHur commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • ArrayIterator::seek(null) now matches php-src soft-null: E_DEPRECATED for parameter #1 ($offset), then seek to offset 0 (was silent coerce).
  • Uses shared VmMath::parseZParamLongBuiltinArgForFrame (Z_PARAM_LONG) like #31723 / #31676.
  • php-src: ext/spl/spl_array.cSPL_METHOD(Array, seek).

Closes #31730

Test plan

  • VM/JIT repro maintainer_gap_arrayiterator_seek_null.php → WARN/DEP + key=0 current=10
  • ./script/phpunit.sh --filter Issue31730ArrayIteratorSeekNullTest → OK (4 tests)
  • Compliance .phpt stdlib/arrayiterator_seek_null_soft.phpt added

Made with Cursor

Use Z_PARAM_LONG soft-null coercion so null offset deprecates and seeks to 0
like php-src, instead of silent coerce.

Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant