Category
Regression: · php-src-strict · SimpleXMLElement null data coercion
Problem
new SimpleXMLElement(null) on Zend soft-deprecates null-to-string then throws Exception: String could not be parsed as XML. VM rejects with TypeError: SimpleXMLElement::__construct(): Argument #1 ($data) must be of type string (no deprecation, no parse path).
Probed 2026-08-16 — host Zend PHP 8.2.32 vs php bin/vm.php.
| Repro |
Zend 8.2+ |
VM (2026-08-16) |
new SimpleXMLElement(null) |
Deprecated $data + Exception: String could not be parsed as XML |
TypeError: … Argument #1 ($data) must be of type string |
php-src reference
PHP implementation target
ext/simplexml/ SimpleXMLElement ctor — soft-deprecate null→string under php-src-strict, then parse; throw Zend-shaped Exception on empty/invalid XML
- No new
runtime/*.c
Repro
./script/docker-exec.sh -- bash -lc 'php test/repro/maintainer_gap_simplexml_null_data.php'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php test/repro/maintainer_gap_simplexml_null_data.php'
Done when
Category
Regression:· php-src-strict · SimpleXMLElement null data coercionProblem
new SimpleXMLElement(null)on Zend soft-deprecates null-to-string then throwsException: String could not be parsed as XML. VM rejects withTypeError: SimpleXMLElement::__construct(): Argument #1 ($data) must be of type string(no deprecation, no parse path).Probed 2026-08-16 — host Zend PHP 8.2.32 vs
php bin/vm.php.new SimpleXMLElement(null)$data+Exception: String could not be parsed as XMLTypeError: … Argument #1 ($data) must be of type stringphp-src reference
ext/simplexml/sxe.c— ctor string coerce + parse failure →Exceptionext/simplexml/simplexml.stub.php—string $data(nullable coercion under weak types)PHP implementation target
ext/simplexml/SimpleXMLElement ctor — soft-deprecate null→string under php-src-strict, then parse; throw Zend-shapedExceptionon empty/invalid XMLruntime/*.cRepro
Done when
new SimpleXMLElement(null)emits Zend deprecation thenException: String could not be parsed as XML