1
0
mirror of https://github.com/php/php-src.git synced 2026-04-17 13:01:02 +02:00
Files
archived-php-src/ext/simplexml/tests/bug62639.phpt
Max Semenik 7f2f0c007c Migrate skip checks to --EXTENSIONS--, p4
For rationale, see #6787

Extensions migrated in part 4:
* simplexml
* skeleton
* soap
* spl
* sqlite3
* sysvmsg
* sysvsem
* tidy - also removed a check for an ancient dependency version
2021-04-08 10:36:44 +02:00

62 lines
870 B
PHP

--TEST--
Bug #62639 (XML structure broken)
--EXTENSIONS--
simplexml
--FILE--
<?php
class A extends SimpleXMLElement
{
}
$xml1 = <<<XML
<?xml version="1.0"?>
<a>
<b>
<c>
<value attr="Some Attr">Some Value</value>
</c>
</b>
</a>
XML;
$a1 = new A($xml1);
foreach ($a1->b->c->children() as $key => $value) {
var_dump($value);
}
$xml2 = <<<XML
<?xml version="1.0"?>
<a>
<b>
<c><value attr="Some Attr">Some Value</value></c>
</b>
</a>
XML;
$a2 = new A($xml2);
foreach ($a2->b->c->children() as $key => $value) {
var_dump($value);
}?>
--EXPECT--
object(A)#2 (2) {
["@attributes"]=>
array(1) {
["attr"]=>
string(9) "Some Attr"
}
[0]=>
string(10) "Some Value"
}
object(A)#3 (2) {
["@attributes"]=>
array(1) {
["attr"]=>
string(9) "Some Attr"
}
[0]=>
string(10) "Some Value"
}