3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function generateCode($length) { return bin2hex(openssl_random_pseudo_bytes($length / 2)); } var_dump(generateCode(6));
Output for 7.1.0
string(6) "c3c299"
Output for 7.0.14
string(6) "0f5352"
Output for 7.0.7
string(6) "987599"
Output for 7.0.6
string(6) "6d41df"
Output for 7.0.5
string(6) "a13be4"
Output for 7.0.4
string(6) "f29c68"
Output for 7.0.3
string(6) "c1de05"
Output for 7.0.2
string(6) "2d00e5"
Output for 7.0.1
string(6) "66399c"
Output for 7.0.0
string(6) "c0db9d"
Output for 5.6.28
string(6) "78df0f"
Output for 5.6.22
string(6) "a5efb6"
Output for 5.6.21
string(6) "568879"
Output for 5.6.20
string(6) "f7af68"
Output for 5.6.19
string(6) "741e21"
Output for 5.6.18
string(6) "52825b"
Output for 5.6.17
string(6) "bbd942"
Output for 5.6.16
string(6) "13fb8f"
Output for 5.6.15
string(6) "48cd0f"
Output for 5.6.14
string(6) "82e787"
Output for 5.6.13
string(6) "bf9cca"
Output for 5.6.12
string(6) "8dea2e"
Output for 5.6.11
string(6) "7c012b"
Output for 5.6.10
string(6) "951fa5"
Output for 5.6.9
string(6) "a92228"
Output for 5.6.8
string(6) "0de90c"
Output for 5.6.7
string(6) "ad0947"
Output for 5.6.6
string(6) "6d077f"
Output for 5.6.5
string(6) "08e157"
Output for 5.6.4
string(6) "21642b"
Output for 5.6.3
string(6) "410905"
Output for 5.6.2
string(6) "d83fa7"
Output for 5.6.1
string(6) "072f41"
Output for 5.6.0
string(6) "775482"
Output for 5.5.36
string(6) "947b14"
Output for 5.5.35
string(6) "dd193e"
Output for 5.5.34
string(6) "592c08"
Output for 5.5.33
string(6) "92d08c"
Output for 5.5.32
string(6) "fc55a4"
Output for 5.5.31
string(6) "a3b8d0"
Output for 5.5.30
string(6) "a211bc"
Output for 5.5.29
string(6) "e2164a"
Output for 5.5.28
string(6) "b05be3"
Output for 5.5.27
string(6) "1b500e"
Output for 5.5.26
string(6) "3ad61a"
Output for 5.5.25
string(6) "1becbf"
Output for 5.5.24
string(6) "de2648"
Output for 5.5.23
string(6) "644741"
Output for 5.5.22
string(6) "b3b0ce"
Output for 5.5.21
string(6) "dcc19a"
Output for 5.5.20
string(6) "cd5adb"
Output for 5.5.19
string(6) "fdcd13"
Output for 5.5.18
string(6) "769377"
Output for 5.5.16
string(6) "d9fc84"
Output for 5.5.15
string(6) "c902cb"
Output for 5.5.14
string(6) "4c58fb"
Output for 5.5.13
string(6) "e21eab"
Output for 5.5.12
string(6) "524a06"
Output for 5.5.11
string(6) "8dd61c"
Output for 5.5.10
string(6) "8ccc7f"
Output for 5.5.9
string(6) "33dbda"
Output for 5.5.8
string(6) "0cfe86"
Output for 5.5.7
string(6) "f5075c"
Output for 5.5.6
string(6) "a62ad6"
Output for 5.5.5
string(6) "8557a0"
Output for 5.5.4
string(6) "7a1d52"
Output for 5.5.3
string(6) "94a4e3"
Output for 5.5.2
string(6) "cd11df"
Output for 5.5.1
string(6) "6cdf40"
Output for 5.5.0
string(6) "97904d"
Output for 5.4.45
string(6) "f12420"
Output for 5.4.44
string(6) "d7afb0"
Output for 5.4.43
string(6) "a762de"
Output for 5.4.42
string(6) "162ba0"
Output for 5.4.41
string(6) "71be9c"
Output for 5.4.40
string(6) "6cb144"
Output for 5.4.39
string(6) "eeaf02"
Output for 5.4.38
string(6) "d9358e"
Output for 5.4.37
string(6) "a00442"
Output for 5.4.36
string(6) "9ef72a"
Output for 5.4.35
string(6) "fa3af3"
Output for 5.4.34
string(6) "1722ff"
Output for 5.4.32
string(6) "4f0cc6"
Output for 5.4.31
string(6) "ff709f"
Output for 5.4.30
string(6) "1673d6"
Output for 5.4.29
string(6) "74144a"
Output for 5.4.28
string(6) "64d4b5"
Output for 5.4.27
string(6) "b9cd6a"
Output for 5.4.26
string(6) "2b62af"
Output for 5.4.25
string(6) "c34cc1"
Output for 5.4.24
string(6) "6ab98b"
Output for 5.4.23
string(6) "865895"
Output for 5.4.22
string(6) "a764b0"
Output for 5.4.21
string(6) "20ef76"
Output for 5.4.20
string(6) "7cccb0"
Output for 5.4.19
string(6) "fcaf92"
Output for 5.4.18
string(6) "b01ab2"
Output for 5.4.17
string(6) "948739"
Output for 5.4.16
string(6) "a9c507"
Output for 5.4.15
string(6) "44ea43"
Output for 5.0.0 - 5.4.14
Fatal error: Call to undefined function openssl_random_pseudo_bytes() in /in/tQ85O on line 3
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/tQ85O on line 3
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/tQ85O on line 3
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/tQ85O on line 3