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( '%x-%04x-%04x-%04x-%04x%04x%04x', 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.0540.00315.08
7.2.90.0130.00615.15
7.2.80.0100.01315.14
7.2.70.0150.00815.26
7.2.60.0100.01315.34
7.2.50.0310.00415.55
7.2.40.1240.01115.60
7.1.220.0660.01313.80
7.1.210.0120.00514.11
7.1.200.0150.00914.45
7.1.190.0140.00714.47
7.1.180.0220.00614.45
7.1.170.0390.00614.25
7.0.310.0280.01014.00
7.0.300.1380.02014.14
5.6.380.0170.01714.52
5.6.370.0220.01414.95
5.6.360.0240.02115.23

preferences:
22.15 ms | 400 KiB | 5 Q