- var_dump: documentation ( source)
- password_hash: documentation ( source)
- preg_replace: documentation ( source)
<?php
$bcrypt = '$2y$13$vBfHHrj12s49n6psX2DjTuPP5ZN6hL9SvmCWfOnFmXm9R3dnPAeyW';
$bcryptNeedsRehash = preg_replace('/\$\d{2}\$/', '\$' . 11 . '\$', $bcrypt);
var_dump($bcrypt, $bcryptNeedsRehash);
var_dump(password_hash('qG$4%7fM', PASSWORD_BCRYPT, array('cost'=>13)));