1--TEST--
2Test error operation of password_needs_rehash()
3--FILE--
4<?php
5
6try {
7    var_dump(password_needs_rehash(''));
8} catch (TypeError $e) {
9    echo $e->getMessage(), "\n";
10}
11
12try {
13    var_dump(password_needs_rehash('', []));
14} catch (TypeError $e) {
15    echo $e->getMessage(), "\n";
16}
17
18try {
19    var_dump(password_needs_rehash(array(), PASSWORD_BCRYPT));
20} catch (TypeError $e) {
21    echo $e->getMessage(), "\n";
22}
23
24try {
25    var_dump(password_needs_rehash("", PASSWORD_BCRYPT, "foo"));
26} catch (TypeError $e) {
27    echo $e->getMessage(), "\n";
28}
29
30echo "OK!";
31?>
32--EXPECT--
33password_needs_rehash() expects at least 2 arguments, 1 given
34password_needs_rehash(): Argument #2 ($algo) must be of type string|int|null, array given
35password_needs_rehash(): Argument #1 ($hash) must be of type string, array given
36password_needs_rehash(): Argument #3 ($options) must be of type array, string given
37OK!
38