1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00
Files
archived-php-src/ext/simplexml/tests/bug61597.phpt
Christoph M. Becker 7c081db885 Fix #61597: SXE properties may lack attributes and content
We must not treat a node as string if it has attributes, unless it is
an entity declaration which is always treated as string by simplexml.
2020-03-12 10:52:28 +01:00

31 lines
575 B
PHP

--TEST--
Bug #61597 (SXE properties may lack attributes and content)
--SKIPIF--
<?php
if (!extension_loaded('simplexml')) die('skip simplexml extension not available');
?>
--FILE--
<?php
$xml = <<<'EOX'
<?xml version="1.0"?>
<data>
<datum file-key="8708124062829849862">corn</datum>
</data>
EOX;
var_dump(simplexml_load_string($xml));
?>
--EXPECTF--
object(SimpleXMLElement)#%d (1) {
["datum"]=>
object(SimpleXMLElement)#%d (2) {
["@attributes"]=>
array(1) {
["file-key"]=>
string(19) "8708124062829849862"
}
[0]=>
string(4) "corn"
}
}