3v4l.org

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

preferences:
40.09 ms | 402 KiB | 5 Q