3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function genRandomString($length=10 ,$characters = '0123456789abcdefghijklmnopqrstuvwxyz',$string = '') { for ($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, strlen($characters[0123456789abcdefghijklmnopqrstuvwxyz])-1)]; } return $string; }
based on S6Yep
Output for 7.0.28 - 7.3.0rc3
Parse error: Invalid numeric literal in /in/aQtcl on line 5
Process exited with code 255.
Output for 5.6.38
Parse error: syntax error, unexpected 'abcdefghijklmnopqrstuvwxyz' (T_STRING), expecting ']' in /in/aQtcl on line 5
Process exited with code 255.