3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = 'აბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰ'; $alphabet_length = strlen($a); $random = openssl_random_pseudo_bytes($len); $password = ''; $len = 8; for ($i = 0; $i < $len; ++$i) { $password .= $alphabet[ord($random[$i]) % $alphabet_length]; } var_dump($password);
Output for 5.4.15 - 5.6.28, hhvm-3.10.0, 7.0.0 - 7.1.0
Notice: Undefined variable: len in /in/mrrkj on line 4 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 string(0) ""
Output for hhvm-3.12.0 - 3.13.2
Notice: Undefined variable: len in /in/mrrkj on line 4 Warning: openssl_random_pseudo_bytes() expects parameter 1 to be integer, null given in /in/mrrkj on line 4 Warning: ord() expects parameter 1 to be string, null given in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 Warning: ord() expects parameter 1 to be string, null given in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 Warning: ord() expects parameter 1 to be string, null given in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 Warning: ord() expects parameter 1 to be string, null given in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 Warning: ord() expects parameter 1 to be string, null given in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 Warning: ord() expects parameter 1 to be string, null given in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 Warning: ord() expects parameter 1 to be string, null given in /in/mrrkj on line 8 Notice: Undefined variable: alphabet in /in/mrrkj on line 8 string(0) ""
Output for 5.0.0 - 5.4.14
Fatal error: Call to undefined function openssl_random_pseudo_bytes() in /in/mrrkj on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: openssl_random_pseudo_bytes() in /in/mrrkj on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: openssl_random_pseudo_bytes() in /in/mrrkj on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: openssl_random_pseudo_bytes() in /in/mrrkj on line 4