3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1() { $s = microtime(true); for ($i = 0; $i < 1000000; $i++) { } return microtime(true) - $s; } function test2() { $s = microtime(true); $i = 0; while ($i < 1000000) { $i++; } return microtime(true) - $s; } function test3() { $s = microtime(true); $i = 0; while ($i++ < 1000000) { } return microtime(true) - $s; } function test4() { $s = microtime(true); for ($i = 0; $i < 1000000; $i++); return microtime(true) - $s; } function test5() { $s = microtime(true); $i = 0; while ($i++ < 1000000); return microtime(true) - $s; } function test6() { $s = microtime(true); $range = range(0, 999999); foreach ($range as $i) { } return microtime(true) - $s; } echo test1() . "\n\n"; echo test2() . "\n\n"; echo test3() . "\n\n"; echo test4() . "\n\n"; echo test5() . "\n\n"; echo test6() . "\n\n";

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.0260.06445.08
7.3.120.0220.07345.14
7.3.110.0190.08845.38
7.3.100.0190.06045.20
7.3.90.0150.06045.29
7.3.80.0150.06045.10
7.3.70.0200.05645.34
7.3.60.0170.06545.27
7.3.50.0190.06445.12
7.3.40.0200.07245.14
7.3.30.0200.07145.18
7.3.20.0140.05548.69
7.3.10.0510.06247.95
7.3.00.1840.05948.33
7.2.250.0250.06845.50
7.2.240.0160.08845.47
7.2.230.0230.05845.38
7.2.220.0190.06145.47
7.2.210.0160.06545.46
7.2.200.0140.06345.48
7.2.190.0180.06045.27
7.2.180.0170.06345.52
7.2.170.0220.06245.42
7.2.160.0240.05445.03
7.2.150.0100.05948.97
7.2.140.0070.06049.04
7.2.130.3890.05647.90
7.2.120.0660.06548.13
7.2.110.0790.06448.04
7.2.100.0580.06848.66
7.2.90.2700.06748.48
7.2.80.4750.06348.76
7.2.70.0880.07848.79
7.2.60.0200.06448.85
7.2.50.0230.06448.83
7.2.40.0220.06748.86
7.2.30.0150.07248.83
7.2.20.0160.06948.85
7.2.10.0190.05948.91
7.2.00.0170.05849.62
7.1.330.0040.14647.78
7.1.320.0090.13047.81
7.1.310.0080.14147.84
7.1.300.0110.13647.89
7.1.290.0100.15547.68
7.1.280.0110.14147.69
7.1.270.0100.13547.66
7.1.260.0040.13747.83
7.1.250.2120.13947.59
7.1.70.0070.08548.83
7.1.60.0100.10349.09
7.1.50.0170.09848.67
7.1.00.0100.13354.27
7.0.200.0070.05848.92
7.0.140.0130.14053.99
7.0.110.0100.12750.46
7.0.100.6000.12350.31
7.0.90.6330.11750.46
7.0.80.6200.14050.47
7.0.70.6330.14350.40
7.0.60.6470.11050.46
7.0.50.6200.13350.29
7.0.40.3500.09050.28
7.0.30.5770.08050.11
7.0.20.1300.06750.06
7.0.10.0870.10050.20
7.0.00.1100.08750.15
5.6.280.0070.26785.57
5.6.260.0200.22785.14
5.6.250.0200.22385.24
5.6.240.0230.22085.20
5.6.230.0430.19785.30
5.6.220.0230.20085.30
5.6.210.0370.21085.46
5.6.200.0270.21785.21
5.6.190.0200.24085.21
5.6.180.0330.24785.51
5.6.170.0230.21085.35
5.6.160.0130.17085.20
5.6.150.0330.22385.33
5.6.140.0330.14085.23
5.6.130.0230.14785.34
5.6.120.0330.16085.27
5.6.110.0170.18385.21
5.6.100.0100.21085.29
5.6.90.0070.18085.22
5.6.80.0270.15384.73
5.6.70.0200.16784.68
5.6.60.0200.17784.71
5.6.50.0400.23384.64
5.6.40.0170.23084.47
5.6.30.0400.18084.71
5.6.20.0230.22784.66
5.6.10.0270.23784.62
5.6.00.0370.20784.63
5.5.380.0200.19782.12
5.5.370.0300.20782.30
5.5.360.0200.23382.27
5.5.350.0300.21782.26
5.5.340.0330.20382.47
5.5.330.0200.21382.57
5.5.320.0330.20382.66
5.5.310.0170.16782.47
5.5.300.0100.23082.54
5.5.290.0170.19082.64
5.5.280.0370.17782.70
5.5.270.0300.19382.77
5.5.260.0200.16782.75
5.5.250.0100.17082.59
5.5.240.0170.15781.89
5.5.230.0170.23381.97
5.5.220.0270.19382.07
5.5.210.0270.20081.97
5.5.200.0200.22381.94
5.5.190.0230.22381.90
5.5.180.0300.22082.10
5.5.160.0130.16781.89
5.5.150.0270.21382.13
5.5.140.0030.23781.89
5.5.130.0270.19081.81
5.5.120.0200.21081.97
5.5.110.0230.23382.10
5.5.100.0200.23081.96
5.5.90.0200.25081.79
5.5.80.0200.23781.77
5.5.70.0530.18081.71
5.5.60.0170.24781.84
5.5.50.0170.17081.80
5.5.40.0300.22081.94
5.5.30.0300.22081.90
5.5.20.0200.21381.83
5.5.10.0300.18081.91
5.5.00.0270.22782.00
5.4.450.0130.19783.95
5.4.440.0200.15084.26
5.4.430.0230.19783.89
5.4.420.0170.15783.86
5.4.410.0130.16783.97
5.4.400.0230.16783.75
5.4.390.0200.23083.56
5.4.380.0270.22383.68
5.4.370.0300.19783.51
5.4.360.0170.22083.93
5.4.350.0270.20083.59
5.4.340.0270.20383.57
5.4.320.0230.22083.59
5.4.310.0170.23383.76
5.4.300.0100.17383.59
5.4.290.0130.21783.58
5.4.280.0300.22783.65
5.4.270.0170.24383.63
5.4.260.0300.20083.58
5.4.250.0270.20783.58
5.4.240.0470.19783.61
5.4.230.0200.23383.93
5.4.220.0200.24083.83
5.4.210.0200.24083.56
5.4.200.0300.23383.59
5.4.190.0230.21383.52
5.4.180.0130.24383.54
5.4.170.0370.21783.58
5.4.160.0170.19783.71
5.4.150.0200.21083.73
5.4.140.0100.22381.07
5.4.130.0170.18380.90
5.4.120.0300.22381.07
5.4.110.0300.19780.94
5.4.100.0300.16780.99
5.4.90.0230.21381.13
5.4.80.0170.17781.15
5.4.70.0230.20381.09
5.4.60.0270.19781.04
5.4.50.0170.15781.03
5.4.40.0130.19081.13
5.4.30.0230.20781.00
5.4.20.0170.20081.08
5.4.10.0230.22080.94
5.4.00.0200.24080.44
5.3.290.0370.21777.93
5.3.280.0170.24377.68
5.3.270.0230.24077.64
5.3.260.0230.26777.77
5.3.250.0300.21777.87
5.3.240.0200.23077.87
5.3.230.0300.22777.79
5.3.220.0330.23077.84
5.3.210.0230.26777.99
5.3.200.0330.16377.66
5.3.190.0170.27077.76
5.3.180.0270.26777.76
5.3.170.0170.23377.73
5.3.160.0170.22077.82
5.3.150.0200.25377.73
5.3.140.0070.22777.57
5.3.130.0170.22777.73
5.3.120.0200.25077.97
5.3.110.0130.20077.76
5.3.100.0230.26077.29
5.3.90.0170.26077.45
5.3.80.0170.25077.38
5.3.70.0330.21377.21
5.3.60.0270.25377.13
5.3.50.0130.26777.53
5.3.40.0200.26777.14
5.3.30.0200.24077.02
5.3.20.0230.25076.81
5.3.10.0300.24076.78
5.3.00.0170.21077.22
5.2.170.0200.26774.66
5.2.160.0270.24774.65
5.2.150.0170.28074.53
5.2.140.0200.29074.64
5.2.130.0100.23074.52
5.2.120.0300.26374.68
5.2.110.0130.30074.68
5.2.100.0170.26374.60
5.2.90.0170.28074.59
5.2.80.0230.22774.75
5.2.70.0100.24374.59
5.2.60.0300.29374.46
5.2.50.0300.29074.66
5.2.40.0270.28774.59
5.2.30.0200.29074.75
5.2.20.0230.25074.74
5.2.10.0270.23374.54
5.2.00.0300.303140.39
5.1.60.0500.337185.58
5.1.50.0430.400185.71
5.1.40.0300.393185.41
5.1.30.0470.413185.85
5.1.20.0300.403186.18
5.1.10.0230.427185.76
5.1.00.0370.390185.57
5.0.50.0670.593184.24
5.0.40.0470.700184.01
5.0.30.0870.570184.08
5.0.20.0400.647183.91
5.0.10.0470.517183.70
5.0.00.0330.533183.66
4.4.90.0400.593181.57
4.4.80.0430.530181.55
4.4.70.0470.513181.55
4.4.60.0470.573181.69
4.4.50.0370.553181.56
4.4.40.0600.597181.65
4.4.30.0530.633181.64
4.4.20.0270.613181.62
4.4.10.0370.483181.67
4.4.00.0330.603181.60
4.3.110.0530.553181.54
4.3.100.0230.617181.48
4.3.90.0230.650181.50
4.3.80.0330.600181.54
4.3.70.0370.640181.48
4.3.60.0500.603181.53
4.3.50.0400.540181.39
4.3.40.0370.567181.46
4.3.30.0570.697180.20
4.3.20.0470.620180.28
4.3.10.0500.653180.10
4.3.00.0430.667179.97

preferences:
45.63 ms | 401 KiB | 5 Q