xref: /PHP-8.0/ext/simplexml/tests/bug37076_1.phpt (revision 6c8fb123)
1--TEST--
2Bug #37076 (SimpleXML ignores .=) (appending to unnamed attribute)
3--SKIPIF--
4<?php if (!extension_loaded("simplexml")) print "skip"; ?>
5--FILE--
6<?php
7
8$xml = simplexml_load_string("<root><foo /></root>");
9
10try {
11    $xml->{""} .= "bar";
12} catch (ValueError $exception) {
13    echo $exception->getMessage() . "\n";
14}
15
16print $xml->asXML();
17?>
18--EXPECT--
19Cannot create element with an empty name
20<?xml version="1.0"?>
21<root><foo/></root>
22