3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function randomFilePrefix($length = 10) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; $randomstr = ""; for($i = 0; $i < $length; $i++) { $randomstr .= $chars[rand(0, count($chars)]; } return $randomstr; } echo randomFilePrefix(10);
Output for 5.3.0 - 5.4.17
Parse error: syntax error, unexpected ']' in /in/hBFSF on line 9
Process exited with code 255.