3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $salt = substr(md5('static salt'), 0, 21); 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 Jq9JN
Output for 7.0.0 - 7.2.0
SALT: 60eeb405ab7d5e80149a9 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/ljSJS on line 8 Warning: password_hash(): Provided salt is too short: 21 expecting 22 in /in/ljSJS on line 8 PASSWORD HASH: Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/ljSJS on line 8 Warning: password_hash(): Provided salt is too short: 21 expecting 22 in /in/ljSJS on line 8 PASSWORD HASH: Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/ljSJS on line 8 Warning: password_hash(): Provided salt is too short: 21 expecting 22 in /in/ljSJS on line 8 PASSWORD HASH: Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/ljSJS on line 8 Warning: password_hash(): Provided salt is too short: 21 expecting 22 in /in/ljSJS on line 8 PASSWORD HASH: Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/ljSJS on line 8 Warning: password_hash(): Provided salt is too short: 21 expecting 22 in /in/ljSJS on line 8 PASSWORD HASH: CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9.lwjb/vs79.Ddl.ZDrb61vp8N3VEVY1. CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9.lwjb/vs79.Ddl.ZDrb61vp8N3VEVY1. CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9.lwjb/vs79.Ddl.ZDrb61vp8N3VEVY1. CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9.lwjb/vs79.Ddl.ZDrb61vp8N3VEVY1. CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9.lwjb/vs79.Ddl.ZDrb61vp8N3VEVY1.
Output for 5.5.24 - 5.6.28
SALT: 60eeb405ab7d5e80149a9 Warning: password_hash(): Provided salt is too short: 21 expecting 22 in /in/ljSJS on line 8 PASSWORD HASH: Warning: password_hash(): Provided salt is too short: 21 expecting 22 in /in/ljSJS on line 8 PASSWORD HASH: Warning: password_hash(): Provided salt is too short: 21 expecting 22 in /in/ljSJS on line 8 PASSWORD HASH: Warning: password_hash(): Provided salt is too short: 21 expecting 22 in /in/ljSJS on line 8 PASSWORD HASH: Warning: password_hash(): Provided salt is too short: 21 expecting 22 in /in/ljSJS on line 8 PASSWORD HASH: CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9.lwjb/vs79.Ddl.ZDrb61vp8N3VEVY1. CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9.lwjb/vs79.Ddl.ZDrb61vp8N3VEVY1. CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9.lwjb/vs79.Ddl.ZDrb61vp8N3VEVY1. CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9.lwjb/vs79.Ddl.ZDrb61vp8N3VEVY1. CRYPT BLOWFISH: $2a$04$60eeb405ab7d5e80149a9.lwjb/vs79.Ddl.ZDrb61vp8N3VEVY1.
Output for 5.4.0 - 5.4.45
SALT: 60eeb405ab7d5e80149a9 Fatal error: Call to undefined function password_hash() in /in/ljSJS on line 8
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/ljSJS on line 8
Process exited with code 255.