3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function generateRandomString($length = 22) { return substr(str_shuffle(str_repeat($x = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ', ceil($length / strlen($x)))), 1, $length); } $generated = []; for ($i = 0; $i < 1000000; $i++) { $generated[] = generateRandomString(); } var_dump(count(array_unique($generated)));
Output for 7.3.0rc3
Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 33554440 bytes) in /in/9d1qQ on line 10
Process exited with code 255.