3v4l.org

run code in 300+ PHP versions simultaneously
<?php function benchmark(callable $function, $args=null, $count=1) { $time = microtime(1); for($i=0; $i<$count; $i++) { $result = is_array($args)? call_user_func_array($function, $args): call_user_func_array($function); } return array( 'total_time' => microtime(1) - $time, 'average_time' => (microtime(1) - $time)/$count, 'count' => $count ); } function p($string) { print_r($string . "<br>"); } var_dump(benchmark('p', array('test',1E4))); gc_collect_cycles(); //var_dump(benchmark('p', array('test',1E3)));

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.4.00.0070.01114.96
7.3.120.0070.00914.95
7.3.110.0100.00814.74
7.3.100.0060.00714.87
7.3.90.0060.00514.80
7.3.80.0050.00714.74
7.3.70.0070.00814.88
7.3.60.0050.00914.85
7.3.50.0100.00614.72
7.3.40.0070.00814.60
7.3.30.0080.00614.68
7.3.20.0060.00816.66
7.3.10.0050.00716.55
7.3.00.0040.00916.73
7.2.250.0130.00615.27
7.2.240.0050.00915.21
7.2.230.0070.00914.86
7.2.220.0060.00815.07
7.2.210.0030.01115.04
7.2.200.0040.01215.00
7.2.190.0050.00915.07
7.2.180.0070.00815.03
7.2.170.0080.00315.19
7.2.160.0140.00014.99
7.2.150.0090.00616.84
7.2.140.0030.00716.83
7.2.130.0070.00716.93
7.2.120.0030.01217.01
7.2.110.0080.00616.92
7.2.100.0050.01016.83
7.2.90.0040.01416.96
7.2.80.0030.01216.90
7.2.70.0100.00116.97
7.2.60.0050.00617.04
7.2.50.0120.00416.85
7.2.40.0050.00916.91
7.2.30.0040.01116.87
7.2.20.0060.00916.85
7.2.10.0050.00516.83
7.2.00.0100.00617.59
7.1.330.0090.00515.82
7.1.320.0050.01015.92
7.1.310.0070.00715.65
7.1.300.0050.01115.87
7.1.290.0050.01115.78
7.1.280.0070.00515.69
7.1.270.0020.01115.75
7.1.260.0030.00815.77
7.1.250.0050.00715.96
7.1.70.0000.00817.22
7.1.60.0140.01119.21
7.1.50.0070.01816.93
7.1.00.0030.06722.40
7.0.200.0190.00616.37
7.0.140.0030.07022.15
7.0.120.0000.05722.09
7.0.60.0170.07020.04
7.0.50.0000.05017.89
7.0.40.0100.06017.75
7.0.30.0100.08317.80
7.0.20.0130.06017.69
7.0.10.0130.06717.72
7.0.00.0070.04017.81
5.6.280.0000.07721.12
5.6.210.0070.08720.54
5.6.200.0000.08718.15
5.6.190.0030.05718.29
5.6.180.0030.04318.22
5.6.170.0030.04318.27
5.6.160.0130.07718.29
5.6.150.0070.04018.28
5.6.140.0070.03718.18
5.6.130.0030.04318.17
5.6.120.0070.08718.18
5.6.110.0070.08718.27
5.6.100.0070.06018.21
5.6.90.0130.08018.13
5.6.80.0100.05717.54
5.6.70.0130.07017.63
5.6.60.0170.06017.51
5.6.50.0130.07317.57
5.6.40.0200.06317.51
5.6.30.0100.06717.54
5.6.20.0030.08317.57
5.6.10.0030.08017.63
5.6.00.0030.08017.49
5.5.350.0030.06320.32
5.5.340.0070.07018.01
5.5.330.0070.08018.04
5.5.320.0100.08017.99
5.5.310.0130.07718.07
5.5.300.0000.06017.94
5.5.290.0070.08017.95
5.5.280.0100.08018.04
5.5.270.0130.07317.98
5.5.260.0030.07317.95
5.5.250.0170.07017.73
5.5.240.0030.05317.47
5.5.230.0070.08017.32
5.5.220.0070.03717.34
5.5.210.0000.07317.32
5.5.200.0130.07017.30
5.5.190.0030.08017.34
5.5.180.0070.07717.40
5.5.160.0170.07017.37
5.5.150.0100.04717.31
5.5.140.0030.05017.43
5.5.130.0070.08017.27
5.5.120.0170.06717.30
5.5.110.0030.08317.43
5.5.100.0130.07017.20
5.5.90.0030.07717.32
5.5.80.0100.04717.17
5.5.70.0130.06317.32
5.5.60.0000.05317.17
5.5.50.0100.07317.22
5.5.40.0070.04017.26
5.5.30.0000.04017.18
5.5.20.0070.03717.20
5.5.10.0070.03317.18
5.5.00.0070.03317.16
5.4.450.0070.06719.35
5.4.440.0000.08019.47
5.4.430.0100.08019.43
5.4.420.0130.07019.59
5.4.410.0130.07019.09
5.4.400.0170.05319.01
5.4.390.0030.08319.05
5.4.380.0070.07019.10
5.4.370.0000.06719.02
5.4.360.0100.08019.03
5.4.350.0070.06719.10
5.4.340.0070.04319.05
5.4.320.0170.07319.05
5.4.310.0030.07719.14
5.4.300.0070.05719.12
5.4.290.0000.08319.13
5.4.280.0070.04719.09
5.4.270.0170.06019.03
5.4.260.0030.07718.95
5.4.250.0100.05018.97
5.4.240.0100.07319.13
5.4.230.0030.05319.03
5.4.220.0070.05019.06
5.4.210.0130.04719.02
5.4.200.0100.08019.04
5.4.190.0030.03719.11
5.4.180.0070.04319.04
5.4.170.0030.03718.94
5.4.160.0000.04019.08
5.4.150.0030.03718.96
5.4.140.0100.02716.49
5.4.130.0070.03316.46
5.4.120.0000.03716.44
5.4.110.0070.03316.54
5.4.100.0070.04016.53
5.4.90.0100.03716.44
5.4.80.0030.04716.44
5.4.70.0100.04016.38
5.4.60.0030.03716.32
5.4.50.0070.03316.36
5.4.40.0000.03716.45
5.4.30.0030.04316.39
5.4.20.0030.03716.29
5.4.10.0000.03716.46
5.4.00.0030.03315.83
5.3.290.0070.05714.71
5.3.280.0070.07714.70
5.3.270.0070.03314.61
5.3.260.0030.03714.65
5.3.250.0030.03714.61
5.3.240.0030.04014.66
5.3.230.0000.04014.68
5.3.220.0030.03714.53
5.3.210.0000.04314.79
5.3.200.0000.04314.58
5.3.190.0030.07314.67
5.3.180.0100.07014.61
5.3.170.0070.03314.42
5.3.160.0000.04014.59
5.3.150.0100.03014.59
5.3.140.0070.03314.64
5.3.130.0000.04314.77
5.3.120.0000.04014.40
5.3.110.0000.04014.58
5.3.100.0000.04014.00
5.3.90.0070.03314.02
5.3.80.0030.03713.91
5.3.70.0000.04014.22
5.3.60.0000.03713.98
5.3.50.0000.03714.00
5.3.40.0000.03714.01
5.3.30.0030.03313.95
5.3.20.0070.03313.70
5.3.10.0070.03013.65
5.3.00.0000.03713.48
5.2.170.0030.03711.14
5.2.160.0030.02711.19
5.2.150.0070.02311.21
5.2.140.0000.03011.13
5.2.130.0000.03011.14
5.2.120.0030.02711.15
5.2.110.0100.02011.17
5.2.100.0000.03011.15
5.2.90.0070.03011.10
5.2.80.0000.03011.12
5.2.70.0000.03011.11
5.2.60.0070.02710.90
5.2.50.0000.03010.87
5.2.40.0070.02310.89
5.2.30.0030.03711.02
5.2.20.0030.03710.99
5.2.10.0030.06310.86
5.2.00.0000.06310.78
5.1.60.0070.0509.98
5.1.50.0030.04010.21
5.1.40.0030.0539.96
5.1.30.0070.05310.36
5.1.20.0000.05710.37
5.1.10.0070.05310.12
5.1.00.0100.0309.93
5.0.50.0070.0338.76
5.0.40.0070.0378.62
5.0.30.0000.0638.25
5.0.20.0130.0338.29
5.0.10.0030.0338.21
5.0.00.0030.0378.13
4.4.90.0030.0137.87
4.4.80.0030.0137.87
4.4.70.0000.0337.87
4.4.60.0000.0237.87
4.4.50.0070.0307.87
4.4.40.0000.0577.87
4.4.30.0030.0277.87
4.4.20.0030.0237.87
4.4.10.0000.0377.87
4.4.00.0030.0537.87
4.3.110.0000.0337.87
4.3.100.0000.0307.87
4.3.90.0030.0337.87
4.3.80.0030.0377.87
4.3.70.0100.0177.87
4.3.60.0000.0277.87
4.3.50.0030.0307.87
4.3.40.0030.0477.87
4.3.30.0070.0307.87
4.3.20.0000.0407.87
4.3.10.0070.0137.87
4.3.00.0000.0377.87

preferences:
40.32 ms | 401 KiB | 5 Q