3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { $foo = array(); for($x = 0; $x < 10000; $x++){ $foo[] = rand(); } return $foo; } $t = microtime(true); for($x=0;$x<100000; $x++){ foreach(foo() as $val){ $val = $val + 2; } } echo round(microtime(true) - $t, 5)."\n"; $t = microtime(true); for($x=0;$x<100000; $x++){ $foo = foo(); foreach($foo as $val){ $val = $val + 2; } } echo round(microtime(true) - $t, 5)."\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.1.70.0002.50116.76
7.1.60.0102.49119.40
7.1.50.0132.48817.15
7.1.00.0002.49722.22
7.0.200.0002.50117.00
7.0.140.0032.49721.95
7.0.120.0072.49322.05
7.0.60.0032.49720.28
7.0.50.0032.49718.16
7.0.40.0032.48319.95
7.0.30.0332.46719.94
7.0.20.0272.47320.00
7.0.10.0032.49719.84
7.0.00.0002.50019.95
5.6.280.1932.30722.28
5.6.210.2102.29022.13
5.6.200.0072.49319.53
5.6.190.2432.19721.61
5.6.180.2132.28721.78
5.6.170.2402.26021.74
5.6.160.2032.29721.52
5.6.150.1632.33719.67
5.6.140.2132.28719.44
5.6.130.2272.27319.61
5.6.120.2202.28022.52
5.6.110.2172.28322.38
5.6.100.2172.28322.30
5.6.90.2132.28722.41
5.6.80.1772.32321.54
5.5.350.2202.23021.89
5.5.340.3132.13322.23
5.5.330.2772.14322.15
5.5.320.2802.16022.41
5.5.310.2702.15722.17
5.5.300.2972.16722.38
5.5.290.2572.18022.24
5.5.280.2702.19022.31
5.5.270.2772.17722.14
5.5.260.2301.78022.25
5.5.250.1601.46322.09
5.5.240.1531.26321.51
5.4.450.3432.11720.82
5.4.440.2172.24020.52
5.4.430.2132.23020.56
5.4.420.1972.10320.56
5.4.410.1971.50020.45
5.4.400.1571.27320.12
5.4.390.1771.19020.38
5.4.380.1601.16720.47
5.4.370.0231.54320.49
5.4.360.2231.63020.37
5.4.350.2932.10720.49
5.4.340.2932.15020.49
5.4.320.2832.14020.46
5.4.310.2572.19320.35
5.4.300.2832.17320.57
5.4.290.2231.98020.48
5.4.280.1491.89017.13
5.4.270.2051.83817.12
5.4.260.2941.76917.07
5.4.250.2351.79817.09
5.4.240.1861.85216.96
5.4.230.2331.81116.99
5.4.220.2381.79917.00
5.4.210.2171.76316.98
5.4.200.2251.81517.13
5.4.190.2301.75717.12
5.4.180.2021.78617.01
5.4.170.2321.91117.07
5.4.160.2072.01716.90
5.4.150.2271.99417.05
5.4.140.2251.90915.53
5.4.130.2131.77915.52
5.4.120.2181.80715.47
5.4.110.2321.78315.43
5.4.100.2221.80315.59
5.4.90.2041.75215.56
5.4.80.2791.71515.51
5.4.70.2041.90615.40
5.4.60.1432.09515.62
5.4.50.2442.00615.57
5.4.40.2162.03715.52
5.4.30.1122.19415.58
5.4.20.2731.99915.53
5.4.10.2412.07115.46
5.4.00.2242.00715.02
5.3.290.0172.41016.16
5.3.280.0151.98115.16
5.3.270.0311.89915.17
5.3.260.0122.20715.19
5.3.250.0232.20615.17
5.3.240.0162.05215.17
5.3.230.0202.04015.16
5.3.220.0331.94515.16
5.3.210.0232.00415.14
5.3.200.0161.97715.16
5.3.190.0232.02015.13
5.3.180.0122.07815.16
5.3.170.0131.99915.14
5.3.160.0122.24515.21
5.3.150.0162.20515.12
5.3.140.0202.22015.13
5.3.130.0192.19415.13
5.3.120.0342.24115.12
5.3.110.0162.22215.12
5.3.100.0202.21814.63
5.3.90.0152.21814.58
5.3.80.0222.20614.52
5.3.70.0132.21914.51
5.3.60.0202.18514.53
5.3.50.0192.22114.53
5.3.40.0072.24114.48

preferences:
33.72 ms | 401 KiB | 5 Q