Skip to content

SPL: LimitIterator::seek(null) soft-null E_DEPRECATED (#31676) - #31690

Merged
PurHur merged 1 commit into
masterfrom
agent/issue-31676-limititerator-seek-null
Aug 17, 2026
Merged

SPL: LimitIterator::seek(null) soft-null E_DEPRECATED (#31676)#31690
PurHur merged 1 commit into
masterfrom
agent/issue-31676-limititerator-seek-null

Conversation

@PurHur

@PurHur PurHur commented Aug 17, 2026

Copy link
Copy Markdown
Owner

Summary

  • LimitIterator::seek(null) now follows php-src Z_PARAM_LONG: E_DEPRECATED for parameter #1 ($offset), then soft-coerce to 0 (no TypeError outside strict_types).
  • Shared helper: VmMath::parseZParamLongBuiltinArgForFrame (same path as #31621 construct soft-null).
  • PHP implementation: ext/spl/LimitIteratorBuiltin.php — no new runtime/*.c.
  • php-src ref: ext/spl/spl_iterators.c zim_LimitIterator_seek.

Closes #31676

Test plan

  • Issue repro (VM):
    ./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_limititerator_seek_null.php'
    
    Output: E_DEPRECATED#1 ($offset) + cur=10 key=0
  • ./script/phpunit.sh --filter Issue31676LimitIteratorSeekNullTest — OK (4 tests: VM/JIT soft + strict TypeError)
  • Compliance case: test/compliance/cases/stdlib/limititerator_seek_null_soft.phpt
  • Not run: full ci-local / compliance suite / bootstrap link (narrow SPL arg coerce)

Made with Cursor

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

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit aacbaba into master Aug 17, 2026
1 check failed
@PurHur
PurHur deleted the agent/issue-31676-limititerator-seek-null branch August 17, 2026 00:02
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: LimitIterator::seek(null) TypeError — Zend E_DEPRECATED soft coerce (ext/spl/spl_iterators.c)

1 participant