3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php protected function generateRandomName($minLength, $maxLength, $alphaNumericOnly = false) { $chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; if (!$alphaNumericOnly) $chars .= ' '; $randomString = ''; $length = mt_rand($minLength, $maxLength); for ($i = 0; $i < $length; $i++) { $randomString .= $chars[rand(0, strlen($chars) - 1)]; } return $randomString; } $time = microtime(true); $i=0; while($i < 10000) { $i++; $this->generateRandomName(10, 18); } $time = microtime(true) - $time; echo 'took ' . number_format($time, 3);
Output for 5.4.0 - 5.4.17
Parse error: syntax error, unexpected 'protected' (T_PROTECTED) in /in/bZXjA on line 3
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected T_PROTECTED in /in/bZXjA on line 3
Process exited with code 255.