3v4l.org

run code in 300+ PHP versions simultaneously
<?php $hashes = array(); $collisions = 0; for($i=0; $i < 6000; $i++){ $hash = hash("crc32", $i); if (in_array($hash, $hashes)) { $collisions++; } else { array_push($hashes, $hash); } } echo $collisions; ?>

preferences:
31.56 ms | 402 KiB | 5 Q