3v4l.org

run code in 300+ PHP versions simultaneously
<?php $max_length_bcrypt = '5a0a90c7caaa07139c8d1bfd848bda29571157799e2abbafe74065e827c01dd29d30f0f1'; $max_length_bcrypt_plus_extra = '5a0a90c7caaa07139c8d1bfd848bda29571157799e2abbafe74065e827c01dd29d30f0f1ae3531ac1956aba81cb4f3d4947f9ca99794132989789acb13655645'; var_dump($max_length_bcrypt, $max_length_bcrypt_plus_extra); $hash_options = [ 'salt' => '31c990a8b44218cc483712' // some awful salt ]; $hash_1 = password_hash($max_length_bcrypt, PASSWORD_BCRYPT, ['salt' => $time_based_awful_salt]); $hash_2 = password_hash($max_length_bcrypt_plus_extra, PASSWORD_BCRYPT, ['salt' => $time_based_awful_salt]); var_dump($hash_1, $hash_2); var_dump($hash_1 === $hash_2);
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.26, 7.3.0 - 7.3.13, 7.4.0 - 7.4.1
string(72) "5a0a90c7caaa07139c8d1bfd848bda29571157799e2abbafe74065e827c01dd29d30f0f1" string(128) "5a0a90c7caaa07139c8d1bfd848bda29571157799e2abbafe74065e827c01dd29d30f0f1ae3531ac1956aba81cb4f3d4947f9ca99794132989789acb13655645" Notice: Undefined variable: time_based_awful_salt in /in/WMrIf on line 12 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/WMrIf on line 12 Warning: password_hash(): Non-string salt parameter supplied in /in/WMrIf on line 12 Notice: Undefined variable: time_based_awful_salt in /in/WMrIf on line 13 Deprecated: password_hash(): Use of the 'salt' option to password_hash is deprecated in /in/WMrIf on line 13 Warning: password_hash(): Non-string salt parameter supplied in /in/WMrIf on line 13 NULL NULL bool(true)
Output for 5.5.0 - 5.5.38, 5.6.0 - 5.6.40
string(72) "5a0a90c7caaa07139c8d1bfd848bda29571157799e2abbafe74065e827c01dd29d30f0f1" string(128) "5a0a90c7caaa07139c8d1bfd848bda29571157799e2abbafe74065e827c01dd29d30f0f1ae3531ac1956aba81cb4f3d4947f9ca99794132989789acb13655645" Notice: Undefined variable: time_based_awful_salt in /in/WMrIf on line 12 Warning: password_hash(): Non-string salt parameter supplied in /in/WMrIf on line 12 Notice: Undefined variable: time_based_awful_salt in /in/WMrIf on line 13 Warning: password_hash(): Non-string salt parameter supplied in /in/WMrIf on line 13 NULL NULL bool(true)
Output for 5.4.0 - 5.4.45
string(72) "5a0a90c7caaa07139c8d1bfd848bda29571157799e2abbafe74065e827c01dd29d30f0f1" string(128) "5a0a90c7caaa07139c8d1bfd848bda29571157799e2abbafe74065e827c01dd29d30f0f1ae3531ac1956aba81cb4f3d4947f9ca99794132989789acb13655645" Fatal error: Call to undefined function password_hash() in /in/WMrIf on line 12
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/WMrIf on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.3.11, 4.4.0 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/WMrIf on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/WMrIf on line 8
Process exited with code 255.

preferences:
224.18 ms | 401 KiB | 325 Q