3v4l.org

run code in 300+ PHP versions simultaneously
<?php $password = 'foobar'; $salt = 'qwertzuiopasdfghjklyxc'; $hash = password_hash($password, PASSWORD_BCRYPT, [ 'salt' => $salt, ]); $froxlor_pwd_salt = str_replace(substr(strrchr($hash, "$"), 1), "", $hash); $froxlor_pwd_check = crypt($password, $froxlor_pwd_salt); $my_pwd_check = crypt($password, $froxlor_pwd_salt . $salt); printf("Password hashed (db): %s\nused salt: %s\n---\nFroxlor password salt: %s\nFroxlor password check: %s\n---\nMy password check: %s", $hash, $salt, $froxlor_pwd_salt, $froxlor_pwd_check, $my_pwd_check);
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.6
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/VdcPB on line 7 Password hashed (db): $2y$10$qwertzuiopasdfghjklyxOX1PtwWRlNoWcltOPJ87LqNf8IYaRwIq used salt: qwertzuiopasdfghjklyxc --- Froxlor password salt: $2y$10$ Froxlor password check: *0 --- My password check: $2y$10$qwertzuiopasdfghjklyxOX1PtwWRlNoWcltOPJ87LqNf8IYaRwIq
Output for 5.5.0 - 5.5.35, 5.6.0 - 5.6.28
Password hashed (db): $2y$10$qwertzuiopasdfghjklyxOX1PtwWRlNoWcltOPJ87LqNf8IYaRwIq used salt: qwertzuiopasdfghjklyxc --- Froxlor password salt: $2y$10$ Froxlor password check: *0 --- My password check: $2y$10$qwertzuiopasdfghjklyxOX1PtwWRlNoWcltOPJ87LqNf8IYaRwIq

preferences:
81.26 ms | 402 KiB | 79 Q