3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $note=<<<XML <note> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note> XML; $xml=simplexml_load_string($note); echo $xml->getName() . "<br>"; foreach($xml->children() as $child) { echo $child->getName() . ": " . $child . "<br>"; }
Output for 5.3.17 - 7.3.0
note<br>to: Tove<br>from: Jani<br>heading: Reminder<br>body: Don't forget me this weekend!<br>