3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr=array( array( array(array( "value1", "value2" ), "value2" ), array( "value3", "value4" ) ), array( array( "value5", "value6" ), array( "value7", "value8" ) ) ); var_debug($arr); function var_debug($variable,$strlen=100,$width=25,$depth=10,$i=0,&$objects = array()) { $search = array("\0", "\a", "\b", "\f", "\n", "\r", "\t", "\v"); $replace = array('\0', '\a', '\b', '\f', '\n', '\r', '\t', '\v'); $string = ''; switch(gettype($variable)) { case 'boolean': $string.= $variable?'true':'false'; break; case 'integer': $string.= $variable; break; case 'double': $string.= $variable; break; case 'resource': $string.= '[resource]'; break; case 'NULL': $string.= "null"; break; case 'unknown type': $string.= '???'; break; case 'string': $len = strlen($variable); $variable = str_replace($search,$replace,substr($variable,0,$strlen),$count); $variable = substr($variable,0,$strlen); if ($len<$strlen) $string.= '"'.$variable.'"'; else $string.= 'string('.$len.'): "'.$variable.'"...'; break; case 'array': $len = count($variable); if ($i==$depth) $string.= 'array('.$len.') {...}'; elseif(!$len) $string.= 'array(0) {}'; else { $keys = array_keys($variable); $spaces = str_repeat(' ',$i*2); $string.= "array($len)\n".$spaces.'{'; $count=0; foreach($keys as $key) { if ($count==$width) { $string.= "\n".$spaces." ..."; break; } $string.= "\n".$spaces." [$key] => "; $string.= var_debug($variable[$key],$strlen,$width,$depth,$i+1,$objects); $count++; } $string.="\n".$spaces.'}'; } break; case 'object': $id = array_search($variable,$objects,true); if ($id!==false) $string.=get_class($variable).'#'.($id+1).' {...}'; else if($i==$depth) $string.=get_class($variable).' {...}'; else { $id = array_push($objects,$variable); $array = (array)$variable; $spaces = str_repeat(' ',$i*2); $string.= get_class($variable)."#$id\n".$spaces.'{'; $properties = array_keys($array); foreach($properties as $property) { $name = str_replace("\0",':',trim($property)); $string.= "\n".$spaces." [$name] => "; $string.= var_debug($array[$property],$strlen,$width,$depth,$i+1,$objects); } $string.= "\n".$spaces.'}'; } break; } if ($i>0) return $string; $backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS); do $caller = array_shift($backtrace); while ($caller && !isset($caller['file'])); if ($caller) $string = $caller['file'].':'.$caller['line']."\n".$string; echo $string; }

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)
8.5.00.0120.01020.09
8.4.150.0020.00014.05
8.4.140.0100.01017.77
8.4.130.0150.00617.99
8.4.120.0110.01022.26
8.4.110.0030.00718.98
8.4.100.0150.00617.72
8.4.90.0130.00720.67
8.4.80.0050.00518.82
8.4.70.0140.00618.04
8.4.60.0090.01118.75
8.4.50.0120.01018.77
8.4.40.0100.01019.11
8.4.30.0090.01218.60
8.4.20.0070.01420.32
8.4.10.0040.00419.50
8.3.280.0050.01618.51
8.3.270.0140.00616.75
8.3.260.0110.00916.88
8.3.250.0060.00719.07
8.3.240.0120.00818.30
8.3.230.0110.00816.62
8.3.220.0090.00919.11
8.3.210.0040.00418.57
8.3.200.0040.00516.90
8.3.190.0060.00817.21
8.3.180.0090.01117.32
8.3.170.0070.01319.20
8.3.160.0140.00417.15
8.3.150.0030.00617.43
8.3.140.0050.00319.07
8.3.130.0080.00018.29
8.3.120.0040.00420.81
8.3.110.0130.00718.50
8.3.100.0070.00316.86
8.3.90.0080.00026.77
8.3.80.0090.00018.43
8.3.70.0190.00316.63
8.3.60.0070.01118.43
8.3.50.0140.00617.23
8.3.40.0090.00618.91
8.3.30.0060.00918.88
8.3.20.0040.00421.89
8.3.10.0000.00821.89
8.3.00.0030.00623.53
8.2.290.0050.00416.84
8.2.280.0070.00218.42
8.2.270.0150.00318.84
8.2.260.0110.00418.49
8.2.250.0120.00318.61
8.2.240.0030.00617.06
8.2.230.0000.00820.94
8.2.220.0090.00024.06
8.2.210.0100.00726.77
8.2.200.0030.00618.16
8.2.190.0090.00916.75
8.2.180.0110.00616.50
8.2.170.0070.00722.96
8.2.160.0140.00020.52
8.2.150.0040.00425.66
8.2.140.0090.00024.66
8.2.130.0020.00526.16
8.2.120.0040.00426.16
8.2.110.0030.00722.24
8.2.100.0130.00017.97
8.2.90.0080.00417.75
8.2.80.0080.00017.97
8.2.70.0030.00518.18
8.2.60.0000.00918.11
8.2.50.0000.00818.10
8.2.40.0040.00421.19
8.2.30.0030.00619.41
8.2.20.0080.00018.27
8.2.10.0030.00619.01
8.2.00.0000.00819.30
8.1.330.0120.00716.35
8.1.320.0100.01016.43
8.1.310.0040.00416.85
8.1.300.0060.00318.40
8.1.290.0060.00318.88
8.1.280.0090.01225.92
8.1.270.0040.00422.59
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0030.00623.75
8.1.230.0060.00619.21
8.1.220.0080.00017.91
8.1.210.0040.00418.77
8.1.200.0030.00817.46
8.1.190.0000.00917.35
8.1.180.0060.00318.10
8.1.170.0050.00318.77
8.1.160.0040.00418.89
8.1.150.0000.00818.98
8.1.140.0070.00018.98
8.1.130.0000.00717.53
8.1.120.0070.00317.59
8.1.110.0030.00517.52
8.1.100.0080.00017.53
8.1.90.0030.00617.53
8.1.80.0040.00417.50
8.1.70.0040.00417.55
8.1.60.0080.00017.73
8.1.50.0040.00417.60
8.1.40.0060.00317.64
8.1.30.0000.00817.77
8.1.20.0040.00417.67
8.1.10.0040.00417.54
8.1.00.0030.00517.54
8.0.300.0050.00319.73
8.0.290.0030.00616.88
8.0.280.0060.00318.60
8.0.270.0000.00817.25
8.0.260.0080.00016.91
8.0.250.0000.00717.05
8.0.240.0000.00716.89
8.0.230.0040.00416.93
8.0.220.0000.00716.99
8.0.210.0060.00316.89
8.0.200.0030.00316.92
8.0.190.0040.00516.93
8.0.180.0040.00416.90
8.0.170.0000.00916.91
8.0.160.0000.00817.05
8.0.150.0040.00416.92
8.0.140.0040.00416.91
8.0.130.0030.00313.43
8.0.120.0070.00016.93
8.0.110.0000.00717.04
8.0.100.0000.00717.03
8.0.90.0000.00716.87
8.0.80.0130.00716.91
8.0.70.0000.00816.96
8.0.60.0070.00016.96
8.0.50.0020.00516.92
8.0.30.0130.00617.23
8.0.20.0130.01617.00
8.0.10.0040.00417.05
8.0.00.0090.01116.89
7.4.330.0030.00315.55
7.4.320.0030.00316.70
7.4.300.0030.00316.58
7.4.290.0000.00816.60
7.4.280.0040.00416.57
7.4.270.0030.00616.70
7.4.260.0070.00016.69
7.4.250.0000.00816.66
7.4.240.0010.00616.68
7.4.230.0000.00716.69
7.4.220.0000.00816.48
7.4.210.0110.00616.67
7.4.200.0030.00316.70
7.4.160.0110.00916.47
7.4.140.0090.00917.86
7.4.130.0090.00916.57
7.4.120.0030.01616.41
7.4.110.0090.01216.57
7.4.100.0100.01316.52
7.4.90.0070.01016.50
7.4.80.0070.01719.39
7.4.70.0040.01316.68
7.4.60.0030.01316.45
7.4.50.0090.00616.70
7.4.40.0120.00616.60
7.3.330.0000.00513.52
7.3.320.0000.00613.40
7.3.310.0000.00716.35
7.3.300.0050.00216.50
7.3.290.0030.00316.50
7.3.280.0120.00416.41
7.3.260.0100.01116.59
7.3.230.0100.01416.72
7.3.210.0060.00916.32
7.3.200.0100.00716.55
7.3.190.0130.00316.46
7.3.180.0060.00916.43
7.3.170.0000.01716.57
7.3.160.0030.01216.59
7.3.60.0070.00714.91
7.3.50.0030.00714.62
7.3.40.0100.00714.80
7.3.30.0070.00715.02
7.3.20.0040.00716.61
7.3.10.0120.00916.60
7.3.00.0130.01016.44
7.2.330.0090.00916.95
7.2.320.0160.02116.87
7.2.310.0060.01116.55
7.2.300.0100.01316.71
7.2.290.0030.01516.84
7.2.190.0030.01015.20
7.2.180.0060.01514.76
7.2.170.0080.00415.14
7.2.160.0150.00615.02
7.2.150.0090.00316.71
7.2.140.0030.02017.09
7.2.130.0110.00016.59
7.2.120.0070.00316.70
7.2.110.0060.00617.09
7.2.100.0110.00316.95
7.2.90.0070.00416.90
7.2.80.0070.00416.88
7.2.70.0040.00717.05
7.2.60.0090.01216.67
7.2.50.0070.00716.87
7.2.40.0120.00316.94
7.2.30.0060.00816.93
7.2.20.0110.00316.97
7.2.10.0140.00016.93
7.2.00.0080.00416.70
7.1.300.0060.00615.68
7.1.290.0130.00715.73
7.1.280.0100.01015.67
7.1.270.0100.00015.68
7.1.260.0070.00715.77
7.1.250.0100.00015.86

preferences:
36.16 ms | 403 KiB | 5 Q