3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php error_reporting(E_ALL); function & XML_unserialize(&$xml){ $xml_parser = new XML(); $data = &$xml_parser->parse($xml); $xml_parser->destruct(); return $data; } function & XMLRPC_parse(&$request){ if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_parse', "<p>Received the following raw request:</p>" . XMLRPC_show($request, 'print_r', true)); } $data = &XML_unserialize(&$request); if(defined('XMLRPC_DEBUG') and XMLRPC_DEBUG){ XMLRPC_debug('XMLRPC_parse', "<p>Returning the following parsed request:</p>" . XMLRPC_show($data, 'print_r', true)); } return $data; } function & XMLRPC_prepare($data, $type = NULL){ if(is_array($data) || is_object($data)){ // Иван Никитин: для PHP5 проверка is_object обязательна! $num_elements = count($data); if((array_key_exists(0, $data) or !$num_elements) and $type != 'struct'){ #it's an array if(!$num_elements){ #if the array is empty $returnvalue = array('array' => array('data' => NULL)); }else{ $returnvalue['array']['data']['value'] = array(); $temp = &$returnvalue['array']['data']['value']; $count = count_numeric_items($data); for($n=0; $n<$count; $n++){ $type = NULL; if(array_key_exists("$n type", $data)){ $type = $data["$n type"]; } $temp[$n] = XMLRPC_prepare($data[$n], $type); } } }else{ #it's a struct if(!$num_elements){ #if the struct is empty $returnvalue = array('struct' => NULL); }else{ $returnvalue['struct']['member'] = array(); $temp = &$returnvalue['struct']['member']; while(list($key, $value) = each($data)){ if(substr($key, -5) != ' type'){ #if it's not a type specifier $type = NULL; if(array_key_exists("$key type", $data)){ $type = $data["$key type"]; } $temp[] = array('name' => $key, 'value' => XMLRPC_prepare($value, $type)); } } } } }else{ #it's a scalar if(!$type){ if(is_int($data)){ $returnvalue['int'] = $data; return $returnvalue; }elseif(is_float($data)){ $returnvalue['double'] = $data; return $returnvalue; }elseif(is_bool($data)){ $returnvalue['boolean'] = ($data ? 1 : 0); return $returnvalue; }elseif(preg_match('/^\d{8}T\d{2}:\d{2}:\d{2}$/', $data, $matches)){ #it's a date $returnvalue['dateTime.iso8601'] = $data; return $returnvalue; }elseif(is_string($data)){ $returnvalue['string'] = htmlspecialchars($data); return $returnvalue; } }else{ $returnvalue[$type] = htmlspecialchars($data); } } return $returnvalue; }
based on vli9r
Output for 5.4.0 - 5.4.32
Fatal error: Call-time pass-by-reference has been removed in /in/GJLYQ on line 14
Process exited with code 255.
Output for 5.3.0 - 5.3.29
Deprecated: Call-time pass-by-reference has been deprecated in /in/GJLYQ on line 14
Output for 5.2.7 - 5.2.17
Warning: Call-time pass-by-reference has been deprecated in /in/GJLYQ on line 14
Output for 5.2.5 - 5.2.6
Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of XML_unserialize(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file in /in/GJLYQ on line 14
Output for 5.2.1 - 5.2.4
Warning: Call-time pass-by-reference has been deprecated; If you would like to pass it by reference, modify the declaration of XML_unserialize(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. in /in/GJLYQ on line 14
Output for 5.0.0 - 5.2.0
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of XML_unserialize(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /in/GJLYQ on line 14
Output for 4.3.0 - 4.4.9
Warning: Call-time pass-by-reference has been deprecated - argument passed by value; If you would like to pass it by reference, modify the declaration of xml_unserialize(). If you would like to enable call-time pass-by-reference, you can set allow_call_time_pass_reference to true in your INI file. However, future versions may not support this any longer. in /in/GJLYQ on line 14