3v4l.org

run code in 200+ PHP versions simultaneously
<?php var_dump(password_hash('foo', -1)); var_dump(password_hash('foo', 'foo')); var_dump(password_hash('foo', PASSWORD_BCRYPT, ['salt' => 'foo'])); var_dump(password_hash('foo', PASSWORD_BCRYPT, ['cost' => 'foo'])); var_dump(password_hash('foo', PASSWORD_ARGON2I, ['memory_cost' => 'foo'])); var_dump(password_hash('foo', PASSWORD_ARGON2I, ['time_cost' => 'foo'])); var_dump(password_hash('foo', PASSWORD_ARGON2I, ['threads' => 'foo']));
based on Xnp0i
Output for 7.4.0
Warning: password_hash(): Unknown password hashing algorithm: -1 in /in/DMv87 on line 3 NULL Warning: password_hash(): Unknown password hashing algorithm: foo in /in/DMv87 on line 5 NULL Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/DMv87 on line 7 Warning: password_hash(): Provided salt is too short: 3 expecting 22 in /in/DMv87 on line 7 NULL Warning: password_hash(): Invalid bcrypt cost parameter specified: 0 in /in/DMv87 on line 8 NULL Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /in/DMv87 on line 10 Warning: password_hash(): Unknown password hashing algorithm: PASSWORD_ARGON2I in /in/DMv87 on line 10 NULL Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /in/DMv87 on line 11 Warning: password_hash(): Unknown password hashing algorithm: PASSWORD_ARGON2I in /in/DMv87 on line 11 NULL Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /in/DMv87 on line 12 Warning: password_hash(): Unknown password hashing algorithm: PASSWORD_ARGON2I in /in/DMv87 on line 12 NULL
Output for 7.3.0 - 7.3.12
Warning: password_hash(): Unknown password hashing algorithm: -1 in /in/DMv87 on line 3 NULL Warning: password_hash() expects parameter 2 to be int, string given in /in/DMv87 on line 5 NULL Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/DMv87 on line 7 Warning: password_hash(): Provided salt is too short: 3 expecting 22 in /in/DMv87 on line 7 NULL Warning: password_hash(): Invalid bcrypt cost parameter specified: 0 in /in/DMv87 on line 8 NULL Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /in/DMv87 on line 10 Warning: password_hash() expects parameter 2 to be int, string given in /in/DMv87 on line 10 NULL Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /in/DMv87 on line 11 Warning: password_hash() expects parameter 2 to be int, string given in /in/DMv87 on line 11 NULL Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /in/DMv87 on line 12 Warning: password_hash() expects parameter 2 to be int, string given in /in/DMv87 on line 12 NULL
Output for 7.2.10 - 7.2.25
Warning: password_hash(): Unknown password hashing algorithm: -1 in /in/DMv87 on line 3 NULL Warning: password_hash() expects parameter 2 to be integer, string given in /in/DMv87 on line 5 NULL Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/DMv87 on line 7 Warning: password_hash(): Provided salt is too short: 3 expecting 22 in /in/DMv87 on line 7 NULL Warning: password_hash(): Invalid bcrypt cost parameter specified: 0 in /in/DMv87 on line 8 NULL Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /in/DMv87 on line 10 Warning: password_hash() expects parameter 2 to be integer, string given in /in/DMv87 on line 10 NULL Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /in/DMv87 on line 11 Warning: password_hash() expects parameter 2 to be integer, string given in /in/DMv87 on line 11 NULL Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /in/DMv87 on line 12 Warning: password_hash() expects parameter 2 to be integer, string given in /in/DMv87 on line 12 NULL
Output for 7.2.0 - 7.2.9
Warning: password_hash(): Unknown password hashing algorithm: -1 in /in/DMv87 on line 3 NULL Warning: password_hash() expects parameter 2 to be integer, string given in /in/DMv87 on line 5 NULL Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/DMv87 on line 7 Warning: password_hash(): Provided salt is too short: 3 expecting 22 in /in/DMv87 on line 7 NULL Warning: password_hash(): Invalid bcrypt cost parameter specified: 0 in /in/DMv87 on line 8 NULL Warning: password_hash(): Memory cost is outside of allowed memory range in /in/DMv87 on line 10 NULL Warning: password_hash(): Time cost is outside of allowed time range in /in/DMv87 on line 11 NULL Warning: password_hash(): Invalid number of threads in /in/DMv87 on line 12 NULL
Output for 7.0.33 - 7.1.33
Warning: password_hash(): Unknown password hashing algorithm: -1 in /in/DMv87 on line 3 NULL Warning: password_hash() expects parameter 2 to be integer, string given in /in/DMv87 on line 5 NULL Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/DMv87 on line 7 Warning: password_hash(): Provided salt is too short: 3 expecting 22 in /in/DMv87 on line 7 NULL Warning: password_hash(): Invalid bcrypt cost parameter specified: 0 in /in/DMv87 on line 8 NULL Notice: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' in /in/DMv87 on line 10 Warning: password_hash() expects parameter 2 to be integer, string given in /in/DMv87 on line 10 NULL Notice: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' in /in/DMv87 on line 11 Warning: password_hash() expects parameter 2 to be integer, string given in /in/DMv87 on line 11 NULL Notice: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' in /in/DMv87 on line 12 Warning: password_hash() expects parameter 2 to be integer, string given in /in/DMv87 on line 12 NULL
Output for 5.6.38 - 5.6.40
Warning: password_hash(): Unknown password hashing algorithm: -1 in /in/DMv87 on line 3 NULL Warning: password_hash() expects parameter 2 to be long, string given in /in/DMv87 on line 5 NULL Warning: password_hash(): Provided salt is too short: 3 expecting 22 in /in/DMv87 on line 7 NULL Warning: password_hash(): Invalid bcrypt cost parameter specified: 0 in /in/DMv87 on line 8 NULL Notice: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' in /in/DMv87 on line 10 Warning: password_hash() expects parameter 2 to be long, string given in /in/DMv87 on line 10 NULL Notice: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' in /in/DMv87 on line 11 Warning: password_hash() expects parameter 2 to be long, string given in /in/DMv87 on line 11 NULL Notice: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' in /in/DMv87 on line 12 Warning: password_hash() expects parameter 2 to be long, string given in /in/DMv87 on line 12 NULL