3v4l.org

run code in 300+ PHP versions simultaneously
<?php $s = '<?xml version="1.0" encoding="utf-8" standalone="yes" ?>'. '<request><body test2="321" test3="987">'. '<rows><my-row test4="564">'. '<types>'. '<custom>this is the example of the text</custom>'. '<Generic arch="simple">this is the example of the text</Generic>'. '<bold/><italic/><underlined/>'. '</types>'. '</my-row><my-row test5="565"/><test hidden="false" ready="true"/></rows>'. '</body></request>'; $obj = new SimpleXmlIterator($s); foreach ($obj as $key => $value) { var_dump($key, $value, '<hr/>'); }
Output for git.master, git.master_jit, rfc.property-hooks
string(4) "body" object(SimpleXMLIterator)#3 (2) { ["@attributes"]=> array(2) { ["test2"]=> string(3) "321" ["test3"]=> string(3) "987" } ["rows"]=> object(SimpleXMLIterator)#4 (2) { ["my-row"]=> array(2) { [0]=> object(SimpleXMLIterator)#5 (2) { ["@attributes"]=> array(1) { ["test4"]=> string(3) "564" } ["types"]=> object(SimpleXMLIterator)#8 (5) { ["custom"]=> string(31) "this is the example of the text" ["Generic"]=> string(31) "this is the example of the text" ["bold"]=> object(SimpleXMLIterator)#9 (0) { } ["italic"]=> object(SimpleXMLIterator)#10 (0) { } ["underlined"]=> object(SimpleXMLIterator)#11 (0) { } } } [1]=> object(SimpleXMLIterator)#6 (1) { ["@attributes"]=> array(1) { ["test5"]=> string(3) "565" } } } ["test"]=> object(SimpleXMLIterator)#7 (1) { ["@attributes"]=> array(2) { ["hidden"]=> string(5) "false" ["ready"]=> string(4) "true" } } } } string(5) "<hr/>"

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
43.72 ms | 403 KiB | 8 Q