3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $salt = substr(md5('static salt'), 0, 22); echo "SALT: " . $salt . PHP_EOL; for ($i = 0; $i < 5; $i++) { echo "PASSWORD HASH: " . password_hash('reddit is fun', PASSWORD_DEFAULT, ['salt' => $salt, 'cost' => 4]) . PHP_EOL; } if (CRYPT_BLOWFISH == 1) { for ($i = 0; $i < 5; $i++) { echo "CRYPT BLOWFISH: " . crypt('reddit is fun', '$2a$04$' . $salt . '$') . PHP_EOL; } }
based on p1JmO
Output for 7.0.0 - 7.2.6
SALT: 60eeb405ab7d5e80149a96 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/Jq9JN on line 8 PASSWORD HASH: $2y$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/Jq9JN on line 8 PASSWORD HASH: $2y$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/Jq9JN on line 8 PASSWORD HASH: $2y$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/Jq9JN on line 8 PASSWORD HASH: $2y$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/Jq9JN on line 8 PASSWORD HASH: $2y$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq
Output for 5.5.0 - 5.6.28
SALT: 60eeb405ab7d5e80149a96 PASSWORD HASH: $2y$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq PASSWORD HASH: $2y$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq PASSWORD HASH: $2y$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq PASSWORD HASH: $2y$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq PASSWORD HASH: $2y$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9unrwEAonENvjv3EdQu/W7M7EQTkh.tRq
Output for 5.4.0 - 5.4.45
SALT: 60eeb405ab7d5e80149a96 Fatal error: Call to undefined function password_hash() in /in/Jq9JN on line 8
Process exited with code 255.