3v4l.org

run code in 300+ PHP versions simultaneously
<?php ini_set('memory_limit', '-1'); $ary1 = array(); $ary2 = array(); $timeBegin = time(); for ($i = 0; $i <= 10000000; $i++) { $ary1[] = $i; } $timeEnd1 = time(); for ($i = 0; $i <= 10000000; $i++) { array_push($ary2, $i); } $timeEnd2 = time(); var_dump($timeBegin, $timeEnd1, $timeEnd2); echo 'first loop take ' . ($timeEnd1 - $timeBegin) . ' seconds' . PHP_EOL; echo 'second loop take ' . ($timeEnd2 - $timeEnd1) . ' seconds' . PHP_EOL;

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.2.60.5370.107146.57
7.2.00.7970.138149.31
7.1.200.3910.110145.66
7.1.102.4890.04366.10
7.1.70.2850.123146.98
7.1.60.0970.144147.21
7.1.50.1350.135147.03
7.1.00.0300.200152.33
7.0.202.3070.05986.95
7.0.90.0330.200151.89
7.0.80.0100.190151.73
7.0.70.0200.133151.77
7.0.60.0300.197151.82
7.0.50.0170.153152.05
7.0.40.0100.157150.13
7.0.30.0100.153150.12
7.0.20.0230.217150.05
7.0.10.0230.207150.12
7.0.00.0170.223149.98
5.6.280.0470.270271.43
5.6.240.1400.297270.78
5.6.230.0870.240270.59
5.6.220.0800.327270.71
5.6.210.0770.273270.75
5.6.200.0470.370271.18
5.6.190.0830.320271.20
5.6.180.0700.333271.31
5.6.170.0870.310271.11
5.6.160.0600.370271.11
5.6.150.0700.347271.06
5.6.140.0730.257271.17
5.6.130.0900.313271.17
5.6.120.0670.360271.17
5.6.110.1000.357271.18
5.6.100.0770.353271.39
5.6.90.0700.303271.18
5.6.80.0670.343270.38
5.6.70.0670.360270.40
5.6.60.0800.320270.48
5.6.50.1170.237270.41
5.6.40.0570.273270.55
5.6.30.0730.310270.59
5.6.20.0530.340270.40
5.6.10.0930.287270.48
5.6.00.0830.317270.50
5.5.380.0730.313270.44
5.5.370.0670.303270.45
5.5.360.0700.387270.45
5.5.350.0670.247270.55
5.5.340.0700.243271.01
5.5.330.0730.333271.01
5.5.320.0570.370270.89
5.5.310.0570.367270.89
5.5.300.0630.260270.91
5.5.290.0770.353271.24
5.5.280.0730.347271.01
5.5.270.0730.337271.01
5.5.260.1130.323271.01
5.5.250.0900.337270.78
5.5.240.0770.307270.11
5.5.230.1400.313270.33
5.5.220.0700.357270.32
5.5.210.0930.330270.33
5.5.200.0800.327270.29
5.5.190.0530.357270.23
5.5.180.0670.330270.34
5.5.160.0830.333270.34
5.5.150.0430.373270.32
5.5.140.1130.327270.23
5.5.130.0670.270270.31
5.5.120.0570.360270.26
5.5.110.1000.367270.16
5.5.100.0900.347270.16
5.5.90.0700.343270.04
5.5.80.0670.360270.24
5.5.70.0730.340270.15
5.5.60.0830.303270.19
5.5.50.0870.350270.18
5.5.40.0570.370270.12
5.5.30.1200.340270.02
5.5.20.0830.340270.13
5.5.10.0900.337270.16
5.5.00.0770.337270.21

preferences:
37.29 ms | 401 KiB | 5 Q