3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function password($len = 12) { $chars = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'; $len = strlen($chars); $multiplier = floor(256 / $len); $bytes = openssl_random_pseudo_bytes($len); return bin2hex($bytes); } echo password();
Output for 7.1.7
6d72dac084142904e45dc9985e5ab0b43c86676a91f2778a5870db63e9f7e13ad8cbcaae40cba8610ff770b38b8d60539cf7257c53547fb81f