3v4l.org

run code in 300+ PHP versions simultaneously
<?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); $hash2 = password_hash(passwd2, PASSWORD_BCRYPT); echo ($hash1 === $hash2 ? 'same' : 'unique');
Output for 7.2.0 - 7.2.13, 7.3.0
Warning: Use of undefined constant passwd1 - assumed 'passwd1' (this will throw an Error in a future version of PHP) in /in/8j1Y0 on line 10 Warning: Use of undefined constant passwd2 - assumed 'passwd2' (this will throw an Error in a future version of PHP) in /in/8j1Y0 on line 11 unique
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.38, 7.0.0 - 7.0.33, 7.1.0 - 7.1.25
Notice: Use of undefined constant passwd1 - assumed 'passwd1' in /in/8j1Y0 on line 10 Notice: Use of undefined constant passwd2 - assumed 'passwd2' in /in/8j1Y0 on line 11 unique
Output for 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45
Fatal error: Call to undefined function password_hash() in /in/8j1Y0 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/8j1Y0 on line 10
Process exited with code 255.
Output for 4.3.2 - 4.3.11, 4.4.0 - 4.4.4
Fatal error: Call to undefined function: password_hash() in /in/8j1Y0 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/8j1Y0 on line 10

preferences:
204.95 ms | 401 KiB | 287 Q