- assert: documentation ( source)
- password_hash: documentation ( source)
- password_verify: documentation ( source)
- strrev: documentation ( source)
<?php
$pw = "\x00\x30";
$hash = password_hash($pw, PASSWORD_DEFAULT);
assert(password_verify(password: 'wrong', hash: $hash) === false, 'Incorect password should not verify');
assert(password_verify(password: '', hash: $hash) === false, 'Blank password should not verify');
assert(password_verify(password: $pw, hash: $hash) === true, 'Correct password should verify');
assert(password_verify(password: strrev($pw), hash: $hash) === false, 'Reversed correct password not should verify');