3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php /** * crypt-test-salt-nul-bytes.php */ $saltLen = 16; $prefix = '$5$'; $length = 63; $plain = 'hello'; $salt = str_repeat("\0", $saltLen); $salt[15] = '.'; $salt[0] = '.'; $salt = ""; $result = crypt($plain, $prefix . $salt); var_dump($result); echo strlen($result) !== $length ? 'FAIL' : 'OK';
Output for 4.3.0 - 5.2.17, 5.3.2 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(47) "$5$$TCRu/ts4Npu8OJyeWy2WnUHCe/6bKVMSi0sROUrPh48" FAIL
Output for 5.3.0 - 5.3.1
string(13) "$5Ig8j7SOu7.6" FAIL