3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $setting = '$2y$04$'; $salt = '1234567890123456789012'; // SAME SALT FOR ALL PASSWORDS, OMG, DON'T $str = '123456789012345678901234567890123456789012345678901234567890123456789012'; $passwd1 = $str . 'A'; $passwd2 = $str . 'B'; $hash1 = password_hash(passwd1, PASSWORD_BCRYPT, array('cost'=>10)); $hash2 = password_hash(passwd2, PASSWORD_BCRYPT, array('cost'=>10)); echo ($hash1 === $hash2 ? 'same' : 'unique');
Output for 5.5.24 - 7.1.0
Notice: Use of undefined constant passwd1 - assumed 'passwd1' in /in/t0dqH on line 10 Notice: Use of undefined constant passwd2 - assumed 'passwd2' in /in/t0dqH on line 11 unique
Output for 5.0.0 - 5.4.45
Fatal error: Call to undefined function password_hash() in /in/t0dqH on line 10
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: password_hash() in /in/t0dqH on line 10
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: password_hash() in /in/t0dqH on line 10
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: password_hash() in /in/t0dqH on line 10