3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $input = '<?xml version="1.0" ?> <data> <action>insert_message</action> <reactid>00000000000000000000000000000000</reactid> <topicid>126628</topicid> <content> [quote][b][message=10028109,noline]aintnosweet schreef op dinsdag 20 september 2011 14:23[/message][/b] .<b>Meedoen? .Check <a href="http://www.frontrunner.nl/converse" class="link">http://www.frontrunner.nl/converse</a></b> [/quote].test </content> <fields> <mobile>iphone</mobile> </fields> </data>'; $xml_parser = xml_parser_create(''); xml_parser_set_option($xml_parser, XML_OPTION_CASE_FOLDING, 0); xml_parse_into_struct($xml_parser, $input, $vals); $inData = false; foreach($vals as $element) { if(strtolower($element['tag']) == 'data') { $inData = !$inData; } elseif($inData) { // if(isset($element['value'])) $data[ $element['tag'] ] = $element['value']; } } var_dump($data);
Output for 5.3.0 - 7.1.0
Notice: Undefined index: value in /in/tf9E9 on line 31 array(4) { ["action"]=> string(14) "insert_message" ["topicid"]=> string(6) "126628" ["fields"]=> NULL ["mobile"]=> string(6) "iphone" }
Output for 5.0.0 - 5.2.17
Notice: Undefined index: value in /in/tf9E9 on line 31 array(4) { ["action"]=> string(14) "insert_message" ["topicid"]=> string(6) "126628" ["fields"]=> NULL ["mobile"]=> string(6) "iphone" }
Output for 4.3.0 - 4.4.9
Notice: Undefined index: value in /in/tf9E9 on line 31 Notice: Undefined index: value in /in/tf9E9 on line 31 Notice: Undefined index: value in /in/tf9E9 on line 31 array(8) { ["action"]=> string(14) "insert_message" ["reactid"]=> string(32) "00000000000000000000000000000000" ["topicid"]=> string(6) "126628" ["content"]=> NULL ["b"]=> NULL ["a"]=> string(34) "http://www.frontrunner.nl/converse" ["fields"]=> NULL ["mobile"]=> string(6) "iphone" }