- var_dump: documentation ( source)
- password_hash: documentation ( source)
<?php
$max_length_bcrypt = '5a0a90c7caaa07139c8d1bfd848bda29571157799e2abbafe74065e827c01dd29d30f0f1';
$max_length_bcrypt_plus_extra = '5a0a90c7caaa07139c8d1bfd848bda29571157799e2abbafe74065e827c01dd29d30f0f1ae3531ac1956aba81cb4f3d4947f9ca99794132989789acb13655645';
var_dump($max_length_bcrypt, $max_length_bcrypt_plus_extra);
$hash_options = [
'salt' => '31c990a8b44218cc483712', // some awful salt
'cost' => 6, // Let's not abuse this wonderful web service (3v4l.org)
];
$hash_1 = password_hash($max_length_bcrypt, PASSWORD_BCRYPT, $hash_options);
$hash_2 = password_hash($max_length_bcrypt_plus_extra, PASSWORD_BCRYPT, $hash_options);
var_dump($hash_1, $hash_2);
var_dump($hash_1 === $hash_2);