Test normal operation of password_get_info() with Argon2
--SKIPIF--
<?php
-if (!defined(PASSWORD_ARGON2)) die('password_get_info not built with Argon2');
+if (!defined('PASSWORD_ARGON2')) die('Skipped: password_get_info not built with Argon2');
+?>
--FILE--
<?php
// Test Argon2i
Test normal operation of password_hash() with argon2
--SKIPIF--
<?php
-if (!defined(PASSWORD_ARGON2)) die('password_get_info not built with Argon2');
+if (!defined('PASSWORD_ARGON2')) die('Skipped: password_get_info not built with Argon2');
--FILE--
<?php
Test error operation of password_hash() with argon2
--SKIPIF--
<?php
-if (!defined(PASSWORD_ARGON2)) die('password_get_info not built with Argon2');
+if (!defined('PASSWORD_ARGON2')) die('Skipped: password_get_info not built with Argon2');
+?>
--FILE--
<?php
var_dump(password_hash('test', PASSWORD_ARGON2, ['m_cost' => 0]));
Test normal operation of password_needs_rehash() with argon2
--SKIPIF--
<?php
-if (!defined(PASSWORD_ARGON2)) die('password_get_info not built with Argon2');
+if (!defined('PASSWORD_ARGON2')) die('Skipped: password_get_info not built with Argon2');
+?>
--FILE--
<?php
var_dump(password_needs_rehash('$argon2i$v=19$m=65536,t=3,p=1$YkprUktYN0lHQTd2bWRFeA$79aA+6IvgclpDAJVoezProlqzIPy7do/P0sBDXS9Nn0', PASSWORD_ARGON2, ['m_cost' => 1<<17]));
Test normal operation of password_verify() with argon2
--SKIPIF--
<?php
-if (!defined(PASSWORD_ARGON2)) die('password_get_info not built with Argon2');
+if (!defined('PASSWORD_ARGON2')) die('Skipped: password_get_info not built with Argon2');
+?>
--FILE--
<?php
-
var_dump(password_verify('test', '$argon2d$v=19$m=32768,t=2,p=1$YWpxd0VYRW9MLmp6VjFPZw$pWV5IsbBfjEK5c0bHzvAo0FsDNHUyM4p6j8vf2cxzb8'));
var_dump(password_verify('argon2', '$argon2d$v=19$m=32768,t=2,p=1$YWpxd0VYRW9MLmp6VjFPZw$pWV5IsbBfjEK5c0bHzvAo0FsDNHUyM4p6j8vf2cxzb8'));