3v4l.org

run code in 300+ PHP versions simultaneously
<?php $test = array(); $i = 10000; while ($i--) { $test[] = mt_rand(0,99999); } class Foo { public function __construct ($input) { echo $input[array_rand($input)] + 1; } } $i = 10000; while ($i--) { new Foo($test); }

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.100.0370.01514.89
7.2.90.2220.01614.73
7.2.80.2290.02314.96
7.2.70.1520.00315.29
7.2.60.1970.02015.10
7.2.50.2310.01015.01
7.2.40.0590.02015.11
7.1.220.1660.02314.21
7.1.210.1730.01013.84
7.1.200.1830.02014.11
7.1.190.2170.02014.05
7.1.180.2230.01714.16
7.1.170.1690.02014.19
7.0.310.2350.41013.63
7.0.300.1710.44913.70
5.6.380.0610.56215.65
5.6.370.0440.56715.83
5.6.360.0450.56515.81

preferences:
33.63 ms | 401 KiB | 5 Q