3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str=<<<XML <control> <prop name='prop_id' value='panel_right_5'/> <prop name='prop_type' value='panel'/> <prop name='width' value='192px'/> <prop name='height' value='208px'/> <prop name='float' value='left'/> <prop name='margin-left' value='2px'/> <prop name='margin-top' value='1px'/> <controls> <control> <prop name='prop_id' value='0'/> <prop name='prop_type' value='button'/> <prop name='prop_style_class' value='estilo_panel_5'/> <prop name='prop_action' value='1'/> <prop name='prop_action_value' value='0'/> <prop name='prop_text1' value='0'/> <prop name='prop_text1_valign' value='middle'/> <prop name='prop_text1_halign' value='center'/> <prop name='width' value='62px'/> <prop name='height' value='50px'/> </control> <control> <prop name='prop_id' value='00'/> <prop name='prop_type' value='button'/> <prop name='prop_style_class' value='estilo_panel_5'/> <prop name='prop_action' value='46'/> <prop name='prop_action_value' value='00'/> <prop name='prop_text1' value='00'/> <prop name='prop_text1_valign' value='middle'/> <prop name='prop_text1_halign' value='center'/> <prop name='width' value='62px'/> <prop name='height' value='50px'/> </control> <control> <prop name='prop_id' value=','/> <prop name='prop_type' value='button'/> <prop name='prop_style_class' value='estilo_panel_5'/> <prop name='prop_action' value='1'/> <prop name='prop_action_value' value=','/> <prop name='prop_text1' value=','/> <prop name='prop_text1_valign' value='middle'/> <prop name='prop_text1_halign' value='center'/> <prop name='width' value='62px'/> <prop name='height' value='50px'/> </control> </controls> </control> XML; $xml=simplexml_load_string($str); $result=$xml->xpath("//control/prop[@name='prop_action'][@value]"); foreach($result as $control) { $parent_div = $control->xpath(".."); echo $parent_div->asXML()."\n\n"; }
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Call to a member function asXML() on array in /in/UGdrf:57 Stack trace: #0 {main} thrown in /in/UGdrf on line 57
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:
32.11 ms | 401 KiB | 8 Q