3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* ########################################################################## # PHP Benchmark Performance Script # # © 2010 Code24 BV # # # # Author : Alessandro Torrisi # # Company : Code24 BV, The Netherlands # # Date : July 31, 2010 # # version : 1.0 # # License : Creative Commons CC-BY license # # Website : http://www.php-benchmark-script.com # # # ########################################################################## */ function test_Math($count = 1400) { $time_start = microtime(true); $mathFunctions = array("abs", "acos", "asin", "atan", "bindec", "floor", "exp", "sin", "tan", "pi", "is_finite", "is_nan", "sqrt"); foreach ($mathFunctions as $key => $function) { if (!function_exists($function)) unset($mathFunctions[$key]); } for ($i=0; $i < $count; $i++) { foreach ($mathFunctions as $function) { $r = call_user_func_array($function, array($i)); } } return number_format(microtime(true) - $time_start, 3); } function test_StringManipulation($count = 1300) { $time_start = microtime(true); $stringFunctions = array("addslashes", "chunk_split", "metaphone", "strip_tags", "md5", "sha1", "strtoupper", "strtolower", "strrev", "strlen", "soundex", "ord"); foreach ($stringFunctions as $key => $function) { if (!function_exists($function)) unset($stringFunctions[$key]); } $string = "the quick brown fox jumps over the lazy dog"; for ($i=0; $i < $count; $i++) { foreach ($stringFunctions as $function) { $r = call_user_func_array($function, array($string)); } } return number_format(microtime(true) - $time_start, 3); } function test_Loops($count = 190000) { $time_start = microtime(true); for($i = 0; $i < $count; ++$i); $i = 0; while($i < $count) ++$i; return number_format(microtime(true) - $time_start, 3); } function test_IfElse($count = 90000) { $time_start = microtime(true); for ($i=0; $i < $count; $i++) { if ($i == -1) { } elseif ($i == -2) { } else if ($i == -3) { } } return number_format(microtime(true) - $time_start, 3); } $total = 0; $functions = get_defined_functions(); $line = str_pad("-",38,"-"); echo "<pre>$line\n|".str_pad("PHP BENCHMARK SCRIPT",36," ",STR_PAD_BOTH)."|\n$line\nStart : ".date("Y-m-d H:i:s")."\nServer : {$_SERVER['SERVER_NAME']}@{$_SERVER['SERVER_ADDR']}\nPHP version : ".PHP_VERSION."\nPlatform : ".PHP_OS. "\n$line\n"; foreach ($functions['user'] as $user) { if (preg_match('/^test_/', $user)) { $total += $result = $user(); echo str_pad($user, 25) . " : " . $result ." sec.\n"; } } echo str_pad("-", 38, "-") . "\n" . str_pad("Total time:", 25) . " : " . $total ." sec.</pre>"; ?>

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)
7.3.120.0000.03015.83
7.3.110.0100.02315.89
7.3.100.0060.02316.04
7.3.90.0070.02215.81
7.3.80.0070.02515.84
7.3.70.0000.02015.95
7.3.60.0040.01815.92
7.3.50.0100.01915.65
7.3.40.0060.02815.63
7.3.30.0030.02115.82
7.3.20.0070.01717.46
7.3.10.0130.01917.70
7.3.00.0080.02317.64
7.2.240.0100.02316.03
7.2.230.0030.02716.10
7.2.220.0100.02116.06
7.2.210.0030.02716.07
7.2.200.0030.02116.14
7.2.190.0100.01616.34
7.2.180.0150.01515.78
7.2.170.0070.03015.96
7.2.160.0030.02715.96
7.2.150.0040.02517.84
7.2.140.0030.02417.87
7.2.130.0120.02417.68
7.2.120.0060.02317.86
7.2.110.0080.02917.80
7.2.100.0060.02417.84
7.2.90.0060.02417.95
7.2.80.0100.01917.90
7.2.70.0140.01917.90
7.2.60.0080.02017.85
7.2.50.0120.01817.87
7.2.40.0060.02017.90
7.2.30.0120.01717.82
7.2.20.0100.01817.90
7.2.10.0090.02117.86
7.2.00.0110.01518.42
7.1.330.0030.04516.38
7.1.320.0030.03116.72
7.1.310.0070.03016.64
7.1.300.0130.02316.76
7.1.290.0100.02716.52
7.1.280.0030.02816.69
7.1.270.0090.02516.70
7.1.260.0070.02816.51
7.1.250.0150.02516.71
7.1.240.0170.02716.79
7.1.230.0140.03516.35
7.1.220.0170.03516.55
7.1.210.0120.03116.62
7.1.200.0100.03416.37
7.1.190.0130.02516.59
7.1.180.0070.03716.47
7.1.170.0100.02416.84
7.1.160.0160.02616.70
7.1.150.0080.03416.68
7.1.140.0070.03616.50
7.1.130.0100.03816.54
7.1.120.0090.02516.80
7.1.110.0130.03716.79
7.1.100.0070.03716.59
7.1.90.0100.03716.88
7.1.80.0120.03216.34
7.1.70.0090.02217.41
7.1.60.0120.03417.96
7.1.50.0080.03017.28
7.1.40.0070.03316.61
7.1.30.0170.02716.70
7.1.20.0100.03616.45
7.1.10.0160.02516.68
7.1.00.0030.06919.80
7.0.330.0160.02916.44
7.0.320.0120.04016.02
7.0.310.0140.03116.19
7.0.300.0100.03516.25
7.0.290.0110.02516.03
7.0.280.0060.03116.29
7.0.270.0100.03316.33
7.0.260.0120.03016.17
7.0.250.0110.03216.25
7.0.240.0100.03316.18
7.0.230.0060.04216.47
7.0.220.0130.02616.37
7.0.210.0090.03416.45
7.0.200.0030.03016.88
7.0.190.0070.03716.49
7.0.180.0130.02816.11
7.0.170.0070.03316.57
7.0.160.0110.03216.49
7.0.150.0150.03016.51
7.0.140.0030.06519.58
7.0.130.0070.03516.04
7.0.120.0170.03116.31
7.0.110.0160.02316.18
7.0.100.0100.03616.29
7.0.90.0100.06419.34
7.0.80.0050.04719.31
7.0.70.0070.06519.23
7.0.60.0030.07319.20
7.0.50.0060.05119.45
7.0.40.0070.06717.50
7.0.30.0070.06717.52
7.0.20.0070.04817.38
7.0.10.0060.03617.43
7.0.00.0150.04017.41
5.6.380.0140.06915.42
5.6.370.0090.07615.36
5.6.360.0070.07015.55
5.6.350.0060.07615.12
5.6.340.0100.06615.80
5.6.330.0000.07715.77
5.6.320.0030.07715.87
5.6.310.0100.06715.52
5.6.300.0030.07515.34
5.6.290.0070.07515.94
5.6.280.0050.09518.78
5.6.270.0100.07415.44
5.6.260.0100.06415.39
5.6.250.0070.07315.51
5.6.240.0030.07118.46
5.6.230.0030.09918.50
5.6.220.0050.09618.44
5.6.210.0070.09718.58
5.6.200.0050.09318.74
5.6.190.0070.10118.61
5.6.180.0050.06918.58
5.6.170.0080.09118.76
5.6.160.0080.06718.66
5.6.150.0030.09818.62
5.6.140.0020.09118.64
5.6.130.0030.09518.70
5.6.120.0050.10418.57
5.6.110.0020.10918.65
5.6.100.0070.10518.78
5.6.90.0020.09418.70
5.6.80.0100.09218.31
5.6.70.0070.08718.30
5.6.60.0070.08418.33
5.6.50.0020.07618.51
5.6.40.0130.09618.28
5.6.30.0030.10518.15
5.6.20.0120.10018.21
5.6.10.0100.09618.22
5.6.00.0080.07818.31
5.5.380.0020.08516.89
5.5.370.0100.09316.78
5.5.360.0070.10016.79
5.5.350.0070.09416.76
5.5.340.0020.10116.96
5.5.330.0070.09816.90
5.5.320.0020.07316.94
5.5.310.0050.07016.94
5.5.300.0030.10316.93
5.5.290.0050.06716.87
5.5.280.0130.05916.99
5.5.270.0030.09316.88
5.5.260.0020.07716.81
5.5.250.0020.09916.86
5.5.240.0050.09616.38
5.5.230.0050.06916.45
5.5.220.0080.09116.59
5.5.210.0080.09416.51
5.5.200.0080.09216.61
5.5.190.0050.09816.50
5.5.180.0090.07516.50
5.5.170.0070.07611.99
5.5.160.0090.09516.51
5.5.150.0070.09916.54
5.5.140.0030.10016.43
5.5.130.0050.09816.64
5.5.120.0080.09216.52
5.5.110.0070.07116.59
5.5.100.0080.08916.49
5.5.90.0060.09016.38
5.5.80.0050.07616.57
5.5.70.0070.08716.55
5.5.60.0050.10016.45
5.5.50.0050.08816.53
5.5.40.0030.10416.56
5.5.30.0050.06316.54
5.5.20.0050.10116.51
5.5.10.0030.08116.36
5.5.00.0050.09916.49
5.4.450.0050.09816.09
5.4.440.0080.06516.30
5.4.430.0050.08516.06
5.4.420.0050.08916.11
5.4.410.0030.08915.98
5.4.400.0070.09515.67
5.4.390.0030.09115.91
5.4.380.0120.08015.89
5.4.370.0180.06716.04
5.4.360.0030.10016.01
5.4.350.0100.08916.03
5.4.340.0080.06815.99
5.4.330.0100.07211.93
5.4.320.0080.09116.07
5.4.310.0070.09715.99
5.4.300.0100.08115.92
5.4.290.0030.07916.09
5.4.280.0080.09415.98
5.4.270.0080.09015.91
5.4.260.0070.07615.88
5.4.250.0050.07015.96
5.4.240.0060.08015.82
5.4.230.0020.07516.06
5.4.220.0080.08216.01
5.4.210.0120.06615.88
5.4.200.0020.09615.93
5.4.190.0050.07515.98
5.4.180.0070.09516.02
5.4.170.0100.09115.97
5.4.160.0050.08816.06
5.4.150.0070.09815.95
5.4.140.0050.09814.67
5.4.130.0060.09214.59
5.4.120.0090.09614.55
5.4.110.0050.07814.58
5.4.100.0070.09714.73
5.4.90.0050.07214.61
5.4.80.0050.08814.67
5.4.70.0080.09114.72
5.4.60.0070.08214.52
5.4.50.0050.08514.73
5.4.40.0050.09414.61
5.4.30.0050.06814.61
5.4.20.0090.06114.72
5.4.10.0030.09514.54
5.4.00.0070.06514.49
5.3.290.0050.10413.66
5.3.280.0070.07513.57
5.3.270.0070.09713.65
5.3.260.0030.10613.71
5.3.250.0030.09813.62
5.3.240.0050.09113.61
5.3.230.0030.10013.63
5.3.220.0080.09313.53
5.3.210.0070.10213.41
5.3.200.0030.07613.45
5.3.190.0080.07713.40
5.3.180.0050.09613.61
5.3.170.0080.08513.62
5.3.160.0020.08213.46
5.3.150.0050.07613.73
5.3.140.0020.08113.63
5.3.130.0050.09913.59
5.3.120.0070.10713.50
5.3.110.0080.09913.49
5.3.100.0100.07113.31
5.3.90.0070.10713.35
5.3.80.0070.06813.20
5.3.70.0050.07713.28
5.3.60.0050.07913.21
5.3.50.0070.10313.13
5.3.40.0030.10213.09
5.3.30.0070.10313.14
5.3.20.0050.09313.11
5.3.10.0120.09612.91
5.3.00.0050.08312.93
5.2.170.0030.09411.25
5.2.160.0150.07511.24
5.2.150.0020.08711.32
5.2.140.0070.10511.30
5.2.130.0030.11211.17
5.2.120.0110.08111.25
5.2.110.0070.08711.21
5.2.100.0050.10511.21
5.2.90.0080.10111.13
5.2.80.0020.11411.10
5.2.70.0070.11111.08
5.2.60.0080.09611.18
5.2.50.0000.10011.02
5.2.40.0030.10911.23
5.2.30.0050.10411.01
5.2.20.0070.11710.97
5.2.10.0070.10710.92
5.2.00.0060.11010.81
5.1.60.0050.11010.22
5.1.50.0020.09210.29
5.1.40.0050.10710.28
5.1.30.0070.10710.61
5.1.20.0050.10210.52
5.1.10.0060.08810.37
5.1.00.0070.10410.11
5.0.50.0050.19210.07
5.0.40.0050.19810.07
5.0.30.0030.21210.07
5.0.20.0050.16810.07
5.0.10.0020.20710.07
5.0.00.0070.20610.07
4.4.90.0050.18010.07
4.4.80.0130.16510.07
4.4.70.0000.17710.07
4.4.60.0030.21510.07
4.4.50.0020.18310.07
4.4.40.0020.16610.07
4.4.30.0030.15810.07
4.4.20.0060.18810.07
4.4.10.0050.17510.07
4.4.00.0030.18910.07
4.3.110.0070.17610.07
4.3.100.0020.18810.07
4.3.90.0020.16310.07
4.3.80.0030.20010.07
4.3.70.0030.18010.07
4.3.60.0030.18110.07
4.3.50.0030.18310.07
4.3.40.0020.18710.07
4.3.30.0020.19410.07
4.3.20.0030.17910.07
4.3.10.0030.19910.07
4.3.00.0000.20010.07

preferences:
41.85 ms | 401 KiB | 5 Q