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
Category
Regression:· php-src-strict · XMLWriter null→string soft-deprecate + empty-name ValueErrorProblem
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-nameValueError(name APIs) or succeeds (content APIs). VM coerces silently (no DEP) and name APIs throw a differentValueErrorshape (Argument #1 ($name)/''/writeElementreportsstartElement).Probed 2026-08-16 — host Zend PHP 8.2.32 vs
php bin/vm.php.startElement(null)$name+ValueError: … Argument #2 must be a valid element name, "" givenArgument #1 ($name) … '' givenwriteElement(null)Argument #2 ($content) must be a valid element name, "" givenstartElement(): Argument #1 ($name) …text(null)/writeComment(null)/writeCdata(null)/writeRaw(null)/setIndentString(null)php-src reference
ext/xmlwriter/php_xmlwriter.c— Z_PARAM_STR soft-null + name validation ValueErrorext/xmlwriter/xmlwriter.stub.php— string paramsPHP implementation target
ext/xmlwriter/XmlWriterClassMethod.php— soft-null viaVmString::stringBuiltinArgForFrame(..., false)(same shape as Regression: SimpleXMLElement::addChild/addAttribute(null) TypeError — Zend Deprecated + ValueError empty (ext/simplexml/sxe.c) #31554)ext/xmlwriter/VmXmlWriter.php— Zend ValueError arg ordinal/message for empty names;writeElementmust not surfacestartElementruntime/*.cRepro
Done when