3v4l.org

run code in 300+ PHP versions simultaneously
<?php function quickRandom($length = 16) { $length = intval($length, 10); $pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $pool_length = 62; $output = ''; while($length--) { $output .= $pool[rand(0,$pool_length - 1)]; } return $output; } echo (quickRandom(311));

preferences:
31.07 ms | 402 KiB | 5 Q