Skip to content

Regression: XMLWriter string args (null) skip soft-null DEP + ValueError arg shape — Zend php_xmlwriter.c #31610

Description

@PurHur

Category

Regression: · php-src-strict · XMLWriter null→string soft-deprecate + empty-name ValueError

Problem

XMLWriter::{startElement,writeElement,startAttribute,writeAttribute,text,writeComment,writeCdata,writeRaw,setIndentString}(null) on Zend soft-deprecates null-to-string for the string parameter, then either throws empty-name ValueError (name APIs) or succeeds (content APIs). VM coerces silently (no DEP) and name APIs throw a different ValueError shape (Argument #1 ($name) / '' / writeElement reports startElement).

Probed 2026-08-16 — host Zend PHP 8.2.32 vs php bin/vm.php.

Repro Zend 8.2+ VM (2026-08-16)
startElement(null) DEP $name + ValueError: … Argument #2 must be a valid element name, "" given no DEP + Argument #1 ($name) … '' given
writeElement(null) DEP + Argument #2 ($content) must be a valid element name, "" given no DEP + startElement(): Argument #1 ($name) …
text(null) / writeComment(null) / writeCdata(null) / writeRaw(null) / setIndentString(null) DEP then ok ok, no DEP

php-src reference

PHP implementation target

Repro

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

Done when

  • Repro matches Zend DEP + ValueError / ok paths on VM (and JIT where lowered)
  • Targeted compliance/PHPUnit guard
  • 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