3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php mt_srand(42); for ($i = 0; $i < 20; $i++) { echo generateKey() . "\n"; } function generateKey() { return base64_encode(randBuffer(48)); } function base64_urlencode($buf) { return str_replace(array('+', '/', '='), array('-', '_', ''), base64_encode($buf)); } function randBuffer($n) { //try { // $buf = openssl_random_pseudo_bytes($n); //} catch (Exception $e) { $buf = ""; for ($i = 0; $i < $n; $i++) { $buf .= chr(mt_rand(0, 255)); } //} return $buf; }
Output for 7.1.0
ZrNcDmpHvBRmedLWSspXdGNnl4KVNAFX650lgb+7FKDLORX861gw2jr+qf/bu88O vb2uvTJrNvM/+ILkMoYUSKYRg1g7DfH5CFk0gVNbbrvGq/wHriLNUKMxZ4MB/YU1 aQM13L6R2Suhyb3jDV4vDsfN1vv4vSfUz+xRbjQXmdj7u3vsKJwOLEBYRghXgOuH 1z6K8lCHoqIgegTp5vkoG4bIRwuhIC/2lj3XJGKrZ9XaIsDiZK7NggAE2fb+jWYa iM4OWSl7zLI+X+bwM/xfg93klubsjqocIwyfRrryVRtBqSw9uPSFGxtrK1MdvUp/ +fZb2Oa94IB4Gr14c8zoAmbFx5qIPaTgMumrl846dZ9f1+izcD3wuTML/SaBgnBk cLdQunABgds1VuTf4ICSfYE0q9mfxZ/2Q7bKt3qQ/iUXRHNhxdWK/u+PYMh7ukXP XAKT+7qjklnC/pKTX8Yz6KCnfyZRZ4AK27jYsZae3SliBvuPWW/48ztwAYAv/YvE JJ/69gjoYpIvz4KTlzV3oJdzSnDHo6VnU/3ib/3YYphckX9tUcE1os+8qOOgQyCN FC+T93+HhsKQfyCvy7py1XYV7Z0l5WwytQcaGuEUHWAbbr/gxPs8L5IDIr8w/xCr 253cLXQFYnvoJBdc8C20XmK74HO+/NSf1qD/Qn8RGOneNTlCZ60XcR+uVZbBfprp gdkQZ6CIKvWvJtyp9hliMZiXDDv5hjgjrBNAB//tj43LctaOW2FBH9a+VTKYuT69 fJU5OVUws6lFDjXqu2TgBzQ762s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