3v4l.org

run code in 300+ PHP versions simultaneously
<?php if (phpversion() != '7.0.0') { die; } $ids = []; for($i=0; $i<300000; $i++) { $time = time(); $randomString1 = bin2hex(random_bytes(20)); $randomString2 = bin2hex(random_bytes(10)); $ids[] = hash('sha512', $time.$randomString1.$randomString2); } $a = array_count_values($ids); asort($a); var_dump( $a[key($a)] );
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.1 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.6
Output for 7.0.0
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 16777224 bytes) in /in/1HsP6 on line 14
Process exited with code 255.

preferences:
88.01 ms | 401 KiB | 90 Q