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), $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.2530.03418.85
7.2.90.1020.04218.91
7.2.80.3580.02918.84
7.2.70.1920.04318.68
7.2.60.1650.02719.11
7.2.50.1290.03019.02
7.2.40.1360.02619.20
7.1.220.2320.05517.95
7.1.210.1000.04317.98
7.1.200.1810.03018.21
7.1.190.1520.05718.29
7.1.180.0980.03017.98
7.1.170.1820.04418.11
7.0.310.1840.04717.57
7.0.300.1990.03317.66
5.6.380.0480.06919.04
5.6.370.0430.09019.42
5.6.360.0340.08018.87

preferences:
36.39 ms | 401 KiB | 5 Q