3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $salt = md5('static salt'); 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 FkRXo
Output for 7.0.0 - 7.3.2
SALT: 60eeb405ab7d5e80149a964623d8b147 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/p1JmO 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/p1JmO 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/p1JmO 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/p1JmO 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/p1JmO 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.38, hhvm-3.10.1 - 3.22.0
SALT: 60eeb405ab7d5e80149a964623d8b147 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: 60eeb405ab7d5e80149a964623d8b147 Fatal error: Call to undefined function password_hash() in /in/p1JmO on line 8
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/p1JmO on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/p1JmO on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/p1JmO on line 8
Process exited with code 255.