3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $xml = '<?xml version="1.0" encoding="utf-8" ?> <soap-env> <person name="Max Musterman"> <car marke="BMW" kennung="i8"/> <phone name="iPhone">9</phone> <birth-place>Hamburg</birth-place> <address> <street>Hauptstraße 1</street> <plz>245698</plz> </address> </person> <person name="Dr. Dolittle"> <car marke="Audi" kennung="A3"/> <phone name="Sony">Xperia Z3</phone> <birth-place>München</birth-place> <address> <street>Partkstraße</street> <plz>365494</plz> </address> </person> </soap-env>'; $doc = new DomDocument('1.0', 'utf-8'); $doc->loadXml($xml); foreach ($doc->children as $child) { print $child->nodeName . PHP_EOL; }
Output for 5.6.30, 7.0.0 - 7.2.11
Notice: Undefined property: DOMDocument::$children in /in/IhgIK on line 28 Warning: Invalid argument supplied for foreach() in /in/IhgIK on line 28
Output for hhvm-3.18.4, hhvm-3.22.0
Notice: Undefined property: DOMDocument::$children in /in/IhgIK on line -1 Warning: Invalid argument supplied for foreach() in /in/IhgIK on line -1
Output for hhvm-3.15.4, hhvm-3.18.5 - 3.21.3
Notice: Undefined property: DOMDocument::$children in /in/IhgIK on line 28 Warning: Invalid argument supplied for foreach() in /in/IhgIK on line 30