Skip to content

Regression: RecursiveTreeIterator::setPostfix(null) TypeError — Zend E_DEPRECATED soft coerce (ext/spl/spl_iterators.c) #31805

Description

@PurHur

Category

Regression: · php-src-strict · SPL soft-null

Problem

RecursiveTreeIterator::setPostfix(null) under non-strict types must emit E_DEPRECATED ("Passing null to parameter #1 ($postfix) of type string is deprecated") and soft-coerce to \"\". VM throws TypeError.

Sibling soft-null: setPrefixPart(null, …) part long (#31677).

Probed 2026-08-17 — host Zend PHP 8.2+ vs php bin/vm.php.

Repro Zend 8.2+ VM (2026-08-17)
$t->setPostfix(null) E_DEPRECATED + empty postfix TypeError

php-src reference

PHP implementation target

  • ext/spl/RecursiveTreeIteratorBuiltin.php — VmString::coerceStringBuiltinArg for $postfix

Repro

./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_rtt_setpostfix_null.php'

Done when

  • VM (+ JIT when covered) emits DEP and stores empty postfix
  • Unit/repro guard; php-src-strict

Activity

  1. added
    bugSomething isn't working
    phase-4:stdlibPhase 4 – stdlib for web apps
    area:vmVirtual machine
    implementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claim
    on Aug 17, 2026
  2. PurHur commented on Aug 17, 2026

    @PurHur
    OwnerAuthor

    claim: PHP Compiler STD Lib Advanced — batch (issues #31803, #31804, #31805, #31806, #31807); starting with #31803 SplDoublyLinkedList::add(null)

  3. PurHur commented on Aug 17, 2026

    @PurHur
    OwnerAuthor

    Merged via #31811

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