php-8.0.30-src/ext/simplexml/tests/bug37076_1.phpt

22 lines
445 B
PHP

--TEST--
Bug #37076 (SimpleXML ignores .=) (appending to unnamed attribute)
--SKIPIF--
<?php if (!extension_loaded("simplexml")) print "skip"; ?>
--FILE--
<?php
$xml = simplexml_load_string("<root><foo /></root>");
try {
$xml->{""} .= "bar";
} catch (ValueError $exception) {
echo $exception->getMessage() . "\n";
}
print $xml->asXML();
?>
--EXPECT--
Cannot create element with an empty name
<?xml version="1.0"?>
<root><foo/></root>