1--TEST-- 2Test error operation of password_hash() with bcrypt hashing 3--FILE-- 4<?php 5//-=-=-=- 6 7var_dump(password_hash("foo", PASSWORD_BCRYPT, array("cost" => 3))); 8 9var_dump(password_hash("foo", PASSWORD_BCRYPT, array("cost" => 32))); 10 11var_dump(password_hash("foo", PASSWORD_BCRYPT, array("salt" => "foo"))); 12 13var_dump(password_hash("foo", PASSWORD_BCRYPT, array("salt" => "123456789012345678901"))); 14 15var_dump(password_hash("foo", PASSWORD_BCRYPT, array("salt" => 123))); 16 17var_dump(password_hash("foo", PASSWORD_BCRYPT, array("cost" => "foo"))); 18 19?> 20--EXPECTF-- 21Warning: password_hash(): Invalid bcrypt cost parameter specified: 3 in %s on line %d 22NULL 23 24Warning: password_hash(): Invalid bcrypt cost parameter specified: 32 in %s on line %d 25NULL 26 27Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in %s on line %d 28 29Warning: password_hash(): Provided salt is too short: 3 expecting 22 in %s on line %d 30NULL 31 32Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in %s on line %d 33 34Warning: password_hash(): Provided salt is too short: 21 expecting 22 in %s on line %d 35NULL 36 37Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in %s on line %d 38 39Warning: password_hash(): Provided salt is too short: 3 expecting 22 in %s on line %d 40NULL 41 42Warning: password_hash(): Invalid bcrypt cost parameter specified: 0 in %s on line %d 43NULL 44