3v4l.org

run code in 300+ PHP versions simultaneously
<?php $uniqueNumbers = 100; $picked = []; $randoms = array_map(function () use(&$picked, $uniqueNumbers) { do { $rand = rand(0, $uniqueNumbers); } while(in_array($rand, $picked)); $picked[] = $rand; return $rand; }, array_fill(0, $uniqueNumbers, null)); sort($randoms); var_dump($randoms);

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)
8.4.30.0080.01319.59
8.1.290.0230.00330.84
8.1.100.0030.00517.41
8.1.70.0070.00417.38
8.1.60.0070.00517.58
8.0.90.0040.00516.87
7.4.330.0100.00017.72
7.4.300.0090.00316.50
7.4.270.0060.00316.59
7.4.260.0120.00416.34
7.4.200.0030.00516.62

preferences:
46.14 ms | 403 KiB | 5 Q