3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = 'აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰ'; $alphabet_length = strlen($alphabet); $password = ''; $len = 8; for ($i = 0; $i < $len; ++$i) { $password .= $alphabet[ord($random[$i]) % $alphabet_length]; } var_dump($password);
Output for 7.0.0 - 7.1.0
Notice: Undefined variable: alphabet in /in/rqDT6 on line 3 Notice: Undefined variable: random in /in/rqDT6 on line 7 Fatal error: Uncaught DivisionByZeroError: Modulo by zero in /in/rqDT6:7 Stack trace: #0 {main} thrown in /in/rqDT6 on line 7
Process exited with code 255.
Output for 5.2.0 - 5.6.28
Notice: Undefined variable: alphabet in /in/rqDT6 on line 3 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 string(0) ""
Output for 5.0.4 - 5.1.6
Notice: Undefined variable: alphabet in /in/rqDT6 on line 3 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 string(0) ""
Output for 4.3.0 - 4.4.4, 5.0.0 - 5.0.3
Notice: Undefined variable: alphabet in /in/rqDT6 on line 3 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 string(0) ""
Output for 4.4.5 - 4.4.9
Notice: Undefined variable: alphabet in /in/rqDT6 on line 3 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 Notice: Undefined variable: random in /in/rqDT6 on line 7 Warning: Division by zero in /in/rqDT6 on line 7 Notice: Undefined variable: alphabet in /in/rqDT6 on line 7 string(0) ""