- 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)
<?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";