1--TEST-- 2Test error operation of password_hash() with bcrypt hashing 3--FILE-- 4<?php 5//-=-=-=- 6try { 7 password_hash("foo", PASSWORD_BCRYPT, array("cost" => 3)); 8} catch (ValueError $exception) { 9 echo $exception->getMessage() . "\n"; 10} 11 12try { 13 var_dump(password_hash("foo", PASSWORD_BCRYPT, array("cost" => 32))); 14} catch (ValueError $exception) { 15 echo $exception->getMessage() . "\n"; 16} 17 18try { 19 var_dump(password_hash("null\0password", PASSWORD_BCRYPT)); 20} catch (ValueError $e) { 21 echo $e->getMessage(), "\n"; 22} 23?> 24--EXPECT-- 25Invalid bcrypt cost parameter specified: 3 26Invalid bcrypt cost parameter specified: 32 27Bcrypt password must not contain null character 28