3v4l.org

run code in 300+ PHP versions simultaneously
<?php $xmlstr = <<<XML <xml> <medium val="organic"> <source val=""> <campaign val=""> <lever3 val="seo">foo</lever3> <lever2 val="seo">bar</lever2> <lever1 val="trafic_gratuit" /> </campaign> </source> </medium> <medium val="cpa"> <source val="affilinet"> <campaign val=""> <lever3 val="affiliation" /> <lever2 val="affiliation" /> <lever1 val="trafic_payant" /> </campaign> </source> </medium> </xml> XML; $xml = new SimpleXMLElement($xmlstr); $res = $xml->xpath("//medium/source/campaign"); while(list( , $node) = each($res)) { echo '/a/b/c: ',$node,"\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to undefined function each() in /in/Dp5sL:31 Stack trace: #0 {main} thrown in /in/Dp5sL on line 31
Process exited with code 255.

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.84 ms | 401 KiB | 8 Q