Category
Regression: · php-src-strict · SimpleXMLElement addChild/addAttribute null name
Problem
Passing null for $qualifiedName on Zend soft-deprecates null-to-string then throws ValueError: … Argument #1 ($qualifiedName) cannot be empty. VM hard-TypeErrors (must be of type string) with no deprecation.
Same soft-null class as open #31514 / #31530 (SimpleXMLElement ctor / xpath).
Probed 2026-08-16 — host Zend PHP 8.2.32 vs php bin/vm.php.
| Repro |
Zend 8.2+ |
VM (2026-08-16) |
$x->addChild(null) |
Deprecated + ValueError: … cannot be empty |
TypeError: … must be of type string |
$x->addAttribute(null, 'v') |
Deprecated + ValueError: … cannot be empty |
TypeError: … must be of type string |
php-src reference
PHP implementation target
ext/simplexml/SimpleXmlElementAddChild.php + SimpleXmlElementAddAttribute.php — under php-src-strict, soft-deprecate null then empty-name ValueError (reuse shared string-arg coerce helpers)
- No new
runtime/*.c
Repro
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_simplexml_addchild_addattribute_null.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_simplexml_addchild_addattribute_null.php'
Done when
Category
Regression:· php-src-strict · SimpleXMLElement addChild/addAttribute null nameProblem
Passing
nullfor$qualifiedNameon Zend soft-deprecates null-to-string then throwsValueError: … Argument #1 ($qualifiedName) cannot be empty. VM hard-TypeErrors (must be of type string) with no deprecation.Same soft-null class as open #31514 / #31530 (SimpleXMLElement ctor / xpath).
Probed 2026-08-16 — host Zend PHP 8.2.32 vs
php bin/vm.php.$x->addChild(null)ValueError: … cannot be emptyTypeError: … must be of type string$x->addAttribute(null, 'v')ValueError: … cannot be emptyTypeError: … must be of type stringphp-src reference
ext/simplexml/sxe.c—zim_SimpleXMLElement_addChild/addAttributenull→string soft coerce then empty-nameValueErrorext/simplexml/simplexml.stub.php—addChild(string $qualifiedName, …)/addAttribute(string $qualifiedName, …)PHP implementation target
ext/simplexml/SimpleXmlElementAddChild.php+SimpleXmlElementAddAttribute.php— under php-src-strict, soft-deprecate null then empty-nameValueError(reuse shared string-arg coerce helpers)runtime/*.cRepro
Done when
addChild(null)/addAttribute(null, …)emit Zend deprecation thenValueError: … cannot be empty