3v4l.org

run code in 300+ PHP versions simultaneously
<?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; }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.320.0100.05012.52
5.4.310.0100.05012.52
5.4.300.0050.04012.52
5.4.290.0090.05012.52
5.4.280.0080.04012.41
5.4.270.0110.03512.41
5.4.260.0030.04312.41
5.4.250.0080.04212.41
5.4.240.0080.05312.41
5.4.230.0080.04112.41
5.4.220.0040.04112.40
5.4.210.0070.03712.40
5.4.200.0090.05012.41
5.4.190.0090.05212.40
5.4.180.0060.03812.40
5.4.170.0120.04812.41
5.4.160.0090.04312.41
5.4.150.0050.03912.40
5.4.140.0100.03612.08
5.4.130.0030.04012.07
5.4.120.0090.04912.03
5.4.110.0080.04812.03
5.4.100.0050.03612.02
5.4.90.0050.03912.03
5.4.80.0070.03712.03
5.4.70.0070.04912.03
5.4.60.0110.04512.02
5.4.50.0100.04812.03
5.4.40.0100.03812.01
5.4.30.0030.05212.00
5.4.20.0100.04712.00
5.4.10.0070.05012.01
5.4.00.0050.03811.50
5.3.290.0050.04312.80
5.3.280.0100.05012.71
5.3.270.0090.05412.73
5.3.260.0050.04712.72
5.3.250.0070.03712.72
5.3.240.0030.04712.72
5.3.230.0080.03712.71
5.3.220.0080.05312.68
5.3.210.0110.05312.68
5.3.200.0110.04912.68
5.3.190.0100.04712.68
5.3.180.0080.03412.68
5.3.170.0120.03112.67
5.3.160.0100.05012.67
5.3.150.0050.05612.68
5.3.140.0070.05212.66
5.3.130.0100.05212.66
5.3.120.0120.05012.66
5.3.110.0050.04412.66
5.3.100.0180.03512.14
5.3.90.0070.03812.13
5.3.80.0110.04412.12
5.3.70.0070.04812.12
5.3.60.0070.04612.10
5.3.50.0080.04812.04
5.3.40.0050.04512.04
5.3.30.0060.03512.01
5.3.20.0080.04311.79
5.3.10.0090.03311.76
5.3.00.0130.03111.75
5.2.170.0080.0289.25
5.2.160.0060.0299.25
5.2.150.0060.0339.25
5.2.140.0050.0319.25
5.2.130.0020.0339.21
5.2.120.0060.0289.21
5.2.110.0070.0289.21
5.2.100.0080.0289.20
5.2.90.0100.0409.21
5.2.80.0070.0419.20
5.2.70.0060.0339.20
5.2.60.0100.0359.16
5.2.50.0060.0329.13
5.2.40.0100.0319.11
5.2.30.0050.0319.07
5.2.20.0100.0289.07
5.2.10.0070.0298.97
5.2.00.0040.0328.84
5.1.60.0060.0318.13
5.1.50.0030.0268.12
5.1.40.0040.0268.10
5.1.30.0070.0258.44
5.1.20.0050.0388.47
5.1.10.0110.0348.20
5.1.00.0040.0418.20
5.0.50.0050.0256.71
5.0.40.0050.0306.57
5.0.30.0040.0416.39
5.0.20.0060.0186.35
5.0.10.0060.0276.34
5.0.00.0080.0346.33
4.4.90.0020.0234.78
4.4.80.0020.0244.76
4.4.70.0060.0164.76
4.4.60.0030.0164.75
4.4.50.0030.0154.77
4.4.40.0060.0304.71
4.4.30.0050.0164.76
4.4.20.0030.0214.85
4.4.10.0030.0184.85
4.4.00.0050.0234.76
4.3.110.0020.0174.67
4.3.100.0020.0164.66
4.3.90.0020.0164.64
4.3.80.0030.0254.59
4.3.70.0050.0134.63
4.3.60.0030.0154.63
4.3.50.0050.0154.63
4.3.40.0020.0264.54
4.3.30.0040.0153.34
4.3.20.0040.0143.32
4.3.10.0020.0153.28
4.3.00.0070.01318.56

preferences:
139.03 ms | 1394 KiB | 7 Q