3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $alphabet = "abcdefghijklmnopqrstuwxyzABCDEFGHIJKLMNOPQRSTUWXYZ0123456789"; $pass = array(); //remember to declare $pass as an array $alphaLength = strlen($alphabet) - 1; //put the length -1 in cache for ($i = 0; $i < $codeLength; $i++) { $n = rand(0, $alphaLength); $pass[] = $alphabet[$n]; } return implode($pass); //turn the array into a string
Output for 5.0.4 - 5.0.5, 5.1.1 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Notice: Undefined variable: codeLength in /in/QdeNf on line 5
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/QdeNf on line 9
Process exited with code 255.
Output for 4.3.0 - 5.0.3
Notice: Undefined variable: codeLength in /in/QdeNf on line 5