3v4l.org

run code in 500+ PHP versions simultaneously
<?php $array = array_merge(range(0, 100), array()); shuffle($array); const LOOPS = 1000; $b = hrtime(true); for ($i = 0; $i < LOOPS; ++$i) { $c = $array; $c = array_unique($c); } $e = hrtime(true); print number_format( ($e - $b) / 1_000_000, 2). " ms\n"; $b = hrtime(true); for ($i = 0; $i < LOOPS; ++$i) { $c = $array; $d = array_keys(array_count_values($c)); } $e = hrtime(true); print number_format(($e - $b) / 1_000_000, 2). " ms\n";

preferences:
52.72 ms | 743 KiB | 5 Q