1
0
mirror of https://github.com/php/php-src.git synced 2026-04-14 11:32:11 +02:00
Files
archived-php-src/ext/simplexml/tests/bug37076_1.phpt
Máté Kocsis 6c8fb123d2 Promote warnings to exceptions in ext/simplexml
Closes GH-6011

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-08-25 15:15:58 +02:00

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>