1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Files
archived-php-src/ext/simplexml/tests/022.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

61 lines
983 B
PHP

--TEST--
SimpleXML: Attributes inside foreach
--EXTENSIONS--
simplexml
--FILE--
<?php
$xml =<<<EOF
<?xml version='1.0'?>
<pres><content><file glob="slide_*.xml"/></content></pres>
EOF;
$sxe = simplexml_load_string($xml);
echo "===CONTENT===\n";
var_dump($sxe->content);
echo "===FILE===\n";
var_dump($sxe->content->file);
echo "===FOREACH===\n";
foreach($sxe->content->file as $file)
{
var_dump($file);
var_dump($file['glob']);
}
?>
--EXPECTF--
===CONTENT===
object(SimpleXMLElement)#%d (1) {
["file"]=>
object(SimpleXMLElement)#%d (1) {
["@attributes"]=>
array(1) {
["glob"]=>
string(11) "slide_*.xml"
}
}
}
===FILE===
object(SimpleXMLElement)#%d (1) {
["@attributes"]=>
array(1) {
["glob"]=>
string(11) "slide_*.xml"
}
}
===FOREACH===
object(SimpleXMLElement)#%d (1) {
["@attributes"]=>
array(1) {
["glob"]=>
string(11) "slide_*.xml"
}
}
object(SimpleXMLElement)#%d (1) {
[0]=>
string(11) "slide_*.xml"
}