3v4l.org

run code in 200+ 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\n used salt: %s\n ---\n Froxlor password salt: %s\n Froxlor password check: %s\n ---\n My password check: %s", $hash, $salt, $froxlor_pwd_salt, $froxlor_pwd_check, $my_pwd_check);
Output for 7.0.0 - 7.4.0rc4
Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/HKuRj 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.6.40
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.4.0 - 5.4.45
Fatal error: Call to undefined function password_hash() in /in/HKuRj on line 6
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/HKuRj on line 6
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/HKuRj on line 6
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/HKuRj on line 6
Process exited with code 255.