1--TEST-- 2Test normal operation of password_hash() 3--FILE-- 4<?php 5//-=-=-=- 6 7var_dump(strlen(password_hash("foo", PASSWORD_BCRYPT))); 8 9$hash = password_hash("foo", PASSWORD_BCRYPT); 10 11var_dump($hash === crypt("foo", $hash)); 12 13var_dump(password_hash("rasmuslerdorf", PASSWORD_BCRYPT, array("cost" => 7, "salt" => "usesomesillystringforsalt"))); 14 15var_dump(password_hash("test", PASSWORD_BCRYPT, array("salt" => "123456789012345678901" . chr(0)))); 16 17echo "OK!"; 18?> 19--EXPECT-- 20int(60) 21bool(true) 22string(60) "$2y$07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6hi" 23string(60) "$2y$10$MTIzNDU2Nzg5MDEyMzQ1Nej0NmcAWSLR.oP7XOR9HD/vjUuOj100y" 24OK! 25 26