3v4l.org

run code in 300+ PHP versions simultaneously
<?php $dangerous_pwd = 'foo' . chr(0) . 'bar'; $wrong_login_1 = 'baz'; $wrong_login_2 = 'foo'; $hash = password_hash($dangerous_pwd, PASSWORD_DEFAULT); if (password_verify($dangerous_pwd, $hash)) echo "this is good!\n"; if (password_verify($wrong_login_1, $hash)) echo "this shouldn't happen! (1)\n"; if (password_verify($wrong_login_2, $hash)) echo "this shouldn't happen, but does! (2)\n";
Output for 7.3.0 - 7.3.27, 7.4.0 - 7.4.16, 8.0.0 - 8.0.3
this is good! this shouldn't happen, but does! (2)

preferences:
43.88 ms | 406 KiB | 5 Q