3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = []; for($i = 0; 9999 > $i; $i++){ $array[] = $i; } $startTimeForLoop = time(); foreach($array as $key => $value){ $foo = 'bar'; } echo 'time needed for loop: ' . time()-$startTimeForLoop; echo '<br>'; $startTimeForEnd = time(); var_dump(end($array)); echo 'time needed for end()' . time()-$startTimeForEnd;

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.0100.01015.27
7.3.120.0100.00615.10
7.3.110.0130.00315.12
7.3.100.0060.00614.99
7.3.90.0060.01015.22
7.3.80.0100.00315.06
7.3.70.0070.01015.00
7.3.60.0120.00415.03
7.3.50.0070.00315.02
7.3.40.0090.00615.06
7.3.30.0070.00715.19
7.3.20.0060.00916.80
7.3.10.0040.01116.66
7.3.00.0070.00716.57
7.2.250.0070.01015.48
7.2.240.0030.01715.52
7.2.230.0000.01515.33
7.2.220.0000.01315.40
7.2.210.0050.00515.55
7.2.200.0080.01215.35
7.2.190.0130.00315.42
7.2.180.0110.00315.52
7.2.170.0070.00715.22
7.2.60.2550.01015.18
7.2.50.2120.00915.32
7.2.40.1710.01315.83
7.2.30.1520.00815.86
7.2.20.1420.00815.91
7.2.10.2250.00815.79
7.2.00.2060.01215.95
7.1.330.0060.01015.72
7.1.320.0100.00715.42
7.1.310.0000.01415.56
7.1.300.0130.00315.82
7.1.290.0070.01015.94
7.1.280.0100.00315.88
7.1.270.0100.00715.82
7.1.260.0040.01115.84
7.1.200.0030.01315.70
7.1.170.1830.00814.05
7.1.160.2410.01017.05
7.1.150.2400.00617.02
7.1.140.2030.01217.12
7.1.130.2490.01117.12
7.1.120.2130.00916.94
7.1.110.1760.01116.75
7.1.100.3070.00916.42
7.1.90.2560.01316.37
7.1.80.2690.01216.37
7.1.70.1990.01415.81
7.1.60.2750.01533.56
7.1.50.2390.01333.09
7.1.40.3370.02532.79
7.1.30.3190.01732.84
7.1.20.3230.01533.14
7.1.10.2150.01315.20
7.1.00.2300.01015.04

preferences:
31.99 ms | 400 KiB | 5 Q