xref: /PHP-8.3/ext/simplexml/tests/bug37076_1.phpt (revision 7f2f0c00)
1--TEST--
2Bug #37076 (SimpleXML ignores .=) (appending to unnamed attribute)
3--EXTENSIONS--
4simplexml
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