3v4l.org

run code in 300+ PHP versions simultaneously
<?php function uuid($c = 4) { $x = function($c) { for ($n = ''; strlen($n) < $c + 1; $n = $n.mt_rand()); return substr($n, -$c); }; return sprintf( '%s-%04d-%04d-%04d-%04d%04d', microtime(true) * 1000, $x($c), $x($c), $x($c), $x($c), $x($c), $x($c) ); } $time = microtime(); $uuids = array(); for ($i = 0; $i < 10000; $i++) { $uuids[] = uuid(); } if (count(array_unique($uuids)) != count($uuids)) { echo 'DUPLICATE'; } else { echo 'No duplicate'; print_r($uuids); }

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.6020.03818.92
7.2.90.1660.03118.78
7.2.80.2470.05118.81
7.2.70.3850.03619.29
7.2.60.4300.03219.21
7.2.50.1800.03619.30
7.2.40.1850.02619.23
7.1.220.2950.03918.23
7.1.210.3340.03017.80
7.1.200.0310.03118.20
7.1.190.2910.04018.13
7.1.180.2570.04818.16
7.1.170.1420.03517.96
7.0.310.3740.04017.65
7.0.300.0900.03717.62
5.6.380.0300.07719.26
5.6.370.0440.07519.41
5.6.360.0350.06619.20

preferences:
32.62 ms | 400 KiB | 5 Q