bug75221.phpt 368 B

1234567891011121314151617
  1. --TEST--
  2. Bug #75221 (Argon2i always throws NUL at the end)
  3. --SKIPIF--
  4. <?php
  5. if (!defined('PASSWORD_ARGON2I')) die('skip password_hash not built with Argon2');
  6. ?>
  7. --FILE--
  8. <?php
  9. $hash = password_hash(
  10. "php",
  11. PASSWORD_ARGON2I,
  12. ['memory_cost' => 64 << 10, 'time_cost' => 4, 'threads' => 1]
  13. );
  14. var_dump(substr($hash, -1, 1) !== "\0");
  15. ?>
  16. --EXPECT--
  17. bool(true)