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); } GeneratePassword(10, 'asdafdfgsaffhdhsd');
Output for 5.3.0 - 5.4.14
Fatal error: Cannot use [] for reading in /in/Su9RY on line 11
Process exited with code 255.