3v4l.org

run code in 300+ PHP versions simultaneously
<?php var_dump(password_hash('foo', -1)); 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']));
Output for 7.3.0 - 7.3.1
Warning: password_hash(): Unknown password hashing algorithm: -1 in /in/Xnp0i on line 3 NULL Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/Xnp0i on line 5 Warning: password_hash(): Provided salt is too short: 3 expecting 22 in /in/Xnp0i on line 5 NULL Warning: password_hash(): Invalid bcrypt cost parameter specified: 0 in /in/Xnp0i on line 6 NULL Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /in/Xnp0i on line 8 Warning: password_hash() expects parameter 2 to be int, string given in /in/Xnp0i 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/Xnp0i on line 9 Warning: password_hash() expects parameter 2 to be int, string given in /in/Xnp0i on line 9 NULL Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /in/Xnp0i on line 10 Warning: password_hash() expects parameter 2 to be int, string given in /in/Xnp0i on line 10 NULL
Output for 7.2.10 - 7.2.13
Warning: password_hash(): Unknown password hashing algorithm: -1 in /in/Xnp0i on line 3 NULL Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/Xnp0i on line 5 Warning: password_hash(): Provided salt is too short: 3 expecting 22 in /in/Xnp0i on line 5 NULL Warning: password_hash(): Invalid bcrypt cost parameter specified: 0 in /in/Xnp0i on line 6 NULL Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /in/Xnp0i on line 8 Warning: password_hash() expects parameter 2 to be integer, string given in /in/Xnp0i 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/Xnp0i on line 9 Warning: password_hash() expects parameter 2 to be integer, string given in /in/Xnp0i on line 9 NULL Warning: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' (this will throw an Error in a future version of PHP) in /in/Xnp0i on line 10 Warning: password_hash() expects parameter 2 to be integer, string given in /in/Xnp0i on line 10 NULL
Output for 7.2.0 - 7.2.9
Warning: password_hash(): Unknown password hashing algorithm: -1 in /in/Xnp0i on line 3 NULL Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/Xnp0i on line 5 Warning: password_hash(): Provided salt is too short: 3 expecting 22 in /in/Xnp0i on line 5 NULL Warning: password_hash(): Invalid bcrypt cost parameter specified: 0 in /in/Xnp0i on line 6 NULL Warning: password_hash(): Memory cost is outside of allowed memory range in /in/Xnp0i on line 8 NULL Warning: password_hash(): Time cost is outside of allowed time range in /in/Xnp0i on line 9 NULL Warning: password_hash(): Invalid number of threads in /in/Xnp0i on line 10 NULL
Output for 7.1.0 - 7.1.25
Warning: password_hash(): Unknown password hashing algorithm: -1 in /in/Xnp0i on line 3 NULL Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/Xnp0i on line 5 Warning: password_hash(): Provided salt is too short: 3 expecting 22 in /in/Xnp0i on line 5 NULL Warning: password_hash(): Invalid bcrypt cost parameter specified: 0 in /in/Xnp0i on line 6 NULL Notice: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' in /in/Xnp0i on line 8 Warning: password_hash() expects parameter 2 to be integer, string given in /in/Xnp0i on line 8 NULL Notice: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' in /in/Xnp0i on line 9 Warning: password_hash() expects parameter 2 to be integer, string given in /in/Xnp0i on line 9 NULL Notice: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' in /in/Xnp0i on line 10 Warning: password_hash() expects parameter 2 to be integer, string given in /in/Xnp0i on line 10 NULL
Output for 5.6.38
Warning: password_hash(): Unknown password hashing algorithm: -1 in /in/Xnp0i on line 3 NULL Warning: password_hash(): Provided salt is too short: 3 expecting 22 in /in/Xnp0i on line 5 NULL Warning: password_hash(): Invalid bcrypt cost parameter specified: 0 in /in/Xnp0i on line 6 NULL Notice: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' in /in/Xnp0i on line 8 Warning: password_hash() expects parameter 2 to be long, string given in /in/Xnp0i on line 8 NULL Notice: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' in /in/Xnp0i on line 9 Warning: password_hash() expects parameter 2 to be long, string given in /in/Xnp0i on line 9 NULL Notice: Use of undefined constant PASSWORD_ARGON2I - assumed 'PASSWORD_ARGON2I' in /in/Xnp0i on line 10 Warning: password_hash() expects parameter 2 to be long, string given in /in/Xnp0i on line 10 NULL

preferences:
68.95 ms | 403 KiB | 48 Q