3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function GeneratePassword ($length,$chars) { $res = array(); $char_length = strlen($chars); for($i = 0; $i < $length; $i++) { $res[] = $chars[rand(0,$char_length)]; } return implode('', $res); } echo generatePassword($length = 16) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
Output for 5.3.0 - 5.5.9
Parse error: syntax error, unexpected '{', expecting ',' or ';' in /in/TILJm on line 17
Process exited with code 255.