3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $str = <<<XML <xml> <medium val="idealo"> <source val=""> <campaign val=""> <lever3 val="comparateur-idealo" /> <lever2 val="comparateur" /> <lever1 val="trafic_payant" /> </campaign> </source> </medium> <medium val="partaenaire"> <source val=""> <campaign val=""> <lever3 val="partenariat" /> <lever2 val="partenariat" /> <lever1 val="trafic_gratuit" /> </campaign> </source> <source val="magasinauchan"> <campaign val=""> <lever3 val="partenaire_hypers" /> <lever2 val="partenaires_hypers" /> <lever1 val="hypers" /> </campaign> </source> </medium> </xml> XML; $xml = simplexml_load_string($str); $x = $xml->xpath("//campaign/*"); $i =0; foreach ($x as $elt){ echo ++$i . "curent::".$x.", attributes::".x->attributes()."\n"; }
Output for 5.4.0 - 5.4.20
Parse error: syntax error, unexpected '->' (T_OBJECT_OPERATOR), expecting ',' or ';' in /in/vTdX3 on line 37
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/vTdX3 on line 37
Process exited with code 255.