3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php var_dump(base64_encode( random_bytes(9) )); var_dump(strtr( base64_encode( random_bytes(9) ), '+/', '-_' ));
based on pjmiU
Output for 7.2.0
string(12) "+8U0G5hNKiT9" string(12) "FyMW6C_ynxau"
Output for 7.1.10
string(12) "KOPPA8l4qrtB" string(12) "RrYvq6tKmiZv"
Output for 7.1.7
string(12) "FbjYoOdHmnH6" string(12) "zS-qNc-rk0YW"
Output for 7.1.6
string(12) "LGB/LjA2zCcI" string(12) "2F8SG6_byx7S"
Output for 7.1.5
string(12) "Sq3sqZYTitCQ" string(12) "AdFdJrqFAhQE"
Output for 7.1.0
string(12) "kgHkosYex6Pu" string(12) "wYw4NmslRGvu"
Output for 7.0.20
string(12) "ZuWWhhZKQL3g" string(12) "lYaxQ6MA0whH"
Output for 7.0.6
string(12) "iKEepNNZbsKx" string(12) "jdDGJ5Yuilmo"
Output for 7.0.5
string(12) "28vaR1apYNj5" string(12) "PeQ0dBLCNe26"
Output for 7.0.4
string(12) "eEMZ1YvrSinL" string(12) "WEUg_zy4L2Xi"
Output for 7.0.3
string(12) "2wIcYPeUvzmg" string(12) "ciA_oO8tF_Yk"
Output for 7.0.2
string(12) "HbZfzGvxw7cK" string(12) "KGqwrmcLsAmC"
Output for 7.0.1
string(12) "LtuSFxH5mTZW" string(12) "6-2O-4Ym4J1-"
Output for 7.0.0
string(12) "JrabDaI878Q8" string(12) "Byk-w7jpJiKa"
Output for 5.3.19 - 5.6.28
Fatal error: Call to undefined function random_bytes() in /in/2s388 on line 4
Process exited with code 255.