Skip to content

Regression: SplDoublyLinkedList offsetGet/Unset/Exists(null) TypeError/silent — Zend E_DEPRECATED soft coerce (ext/spl/spl_dllist.c) #31804

Description

@PurHur

Category

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

Problem

SplDoublyLinkedList::{offsetGet,offsetUnset,offsetExists}(null) under non-strict types must emit E_DEPRECATED for parameter #1 ($index) and soft-coerce to 0. Today:

  • offsetGet / offsetUnset → TypeError
  • offsetExists → silent true (no DEP)

offsetSet(null) remains append-without-DEP (#31731).

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

Repro Zend 8.2+ VM (2026-08-17)
offsetGet(null) DEP + value at 0 TypeError
offsetUnset(null) DEP + removes index 0 TypeError
offsetExists(null) DEP + true silent true

php-src reference

PHP implementation target

  • ext/spl/SplDoublyLinkedListBuiltin.php — coerceIndex soft-null DEP for get/unset/exists

Repro

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

Done when

  • VM (+ JIT when covered) matches Zend DEP + coerce-to-0 for get/unset/exists
  • 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 #31810

    Verification: VM/JIT soft-null DEP for offsetGet/Exists/Unset; strict_types TypeError; sibling #31803/#31731 still OK.

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