3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $xmlstr = <<<XML <mainGroup> <groupHeading type="heading">This is a sample heading</groupHeading> <group type="groupType1"> <title>Title1</title> <date when="0001"></date> </group> <group type="groupType1"> <title>Title2</title> <date when="0002"></date> </group> <group type="groupType2"> <title>Title3</title> <date when="0003"></date> </group> </mainGroup> XML; $xml=simplexml_load_string($xmlstr); // now loop through all <groupheading>, we use an xpath-query... foreach ($xml->xpath("//groupheading") as $gh) { echo $gh; }
Output for 5.4.0 - 5.4.13
Parse error: syntax error, unexpected end of file in /in/KMlBC on line 28
Process exited with code 255.
Output for 5.3.0 - 5.3.23
Parse error: syntax error, unexpected $end in /in/KMlBC on line 28
Process exited with code 255.