3v4l.org

run code in 300+ PHP versions simultaneously
<?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';

preferences:
39.93 ms | 402 KiB | 5 Q