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) * 10000, $x($c), $x($c), $x($c), $x($c), $x($c), $x($c) ); } $time = microtime(); $uuids = array(); for ($i = 0; $i < 1000; $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.1550.01015.31
7.2.90.1360.01015.01
7.2.80.1820.00315.23
7.2.70.1450.00715.16
7.2.60.1100.00315.28
7.2.50.1390.01315.30
7.2.40.1150.01314.88
7.1.220.1190.00614.22
7.1.210.1410.00614.13
7.1.200.1460.00614.27
7.1.190.1410.00614.13
7.1.180.1110.01214.22
7.1.170.1770.00313.99
7.0.310.1270.01314.10
7.0.300.1500.01213.94
5.6.380.0340.00614.77
5.6.370.0030.02714.74
5.6.360.0240.01314.81

preferences:
33.44 ms | 400 KiB | 5 Q