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); var_dump($hash, $froxlor_pwd_check);
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.11
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/Bub6H on line 7 string(60) "$2y$10$qwertzuiopasdfghjklyxOX1PtwWRlNoWcltOPJ87LqNf8IYaRwIq" string(2) "*0"
Output for 5.5.0 - 5.5.35, 5.6.0 - 5.6.28
string(60) "$2y$10$qwertzuiopasdfghjklyxOX1PtwWRlNoWcltOPJ87LqNf8IYaRwIq" string(2) "*0"

preferences:
90.62 ms | 401 KiB | 80 Q