1--TEST-- 2Test normal operation of password_hash() with Argon2i and Argon2id 3--SKIPIF-- 4<?php 5if (!defined('PASSWORD_ARGON2I')) die('skip password_hash not built with Argon2'); 6if (!defined('PASSWORD_ARGON2ID')) die('skip password_hash not built with Argon2'); 7--FILE-- 8<?php 9 10$password = "the password for testing 12345!"; 11 12$algos = [ 13 PASSWORD_ARGON2I, 14 'argon2i', 15 2, 16 PASSWORD_ARGON2ID, 17 'argon2id', 18 3, 19]; 20foreach ($algos as $algo) { 21 $hash = password_hash($password, $algo); 22 var_dump(password_verify($password, $hash)); 23 var_dump(password_get_info($hash)['algo']); 24} 25 26echo "OK!"; 27?> 28--EXPECT-- 29bool(true) 30string(7) "argon2i" 31bool(true) 32string(7) "argon2i" 33bool(true) 34string(7) "argon2i" 35bool(true) 36string(8) "argon2id" 37bool(true) 38string(8) "argon2id" 39bool(true) 40string(8) "argon2id" 41OK! 42