3v4l.org

run code in 300+ PHP versions simultaneously
<?php function genRandomString($length=1,$characters = '0123',$string = '') { for ($p = 0; $p < $length; $p++) { $string .= $characters[mt_rand(0, strlen($characters))]; } return $string; } echo (genRandomString);
Output for 7.2.0 - 7.2.11
Warning: Use of undefined constant genRandomString - assumed 'genRandomString' (this will throw an Error in a future version of PHP) in /in/N7At3 on line 9 genRandomString
Output for 5.6.38, 7.1.0 - 7.1.23
Notice: Use of undefined constant genRandomString - assumed 'genRandomString' in /in/N7At3 on line 9 genRandomString

preferences:
69.66 ms | 402 KiB | 42 Q