3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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='1'/> <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("//prop[@name='prop_action'][@value='46']"); foreach($result as $node) { echo $node->attributes()->prop_id."\n"; }
based on amoUD
Output for 5.0.0 - 7.2.0
Output for 4.4.3 - 4.4.9
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/6W6YA on line 56
Process exited with code 255.
Output for 4.4.2
Parse error: syntax error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/6W6YA on line 57
Process exited with code 255.
Output for 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in /in/6W6YA on line 56
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/6W6YA on line 56
Process exited with code 255.
Output for 4.3.0

Process exited with code 137.