3v4l.org

run code in 200+ 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 'cost' => 3, // Let's not abuse this wonderful web service (3v4l.org) ]; $hash_1 = password_hash($max_length_bcrypt, PASSWORD_BCRYPT, $hash_options); $hash_2 = password_hash($max_length_bcrypt_plus_extra, PASSWORD_BCRYPT, $hash_options); var_dump($hash_1, $hash_2); var_dump($hash_1 === $hash_2);
based on WMrIf
Output for 5.5.0 - 7.4.1
string(72) "5a0a90c7caaa07139c8d1bfd848bda29571157799e2abbafe74065e827c01dd29d30f0f1" string(128) "5a0a90c7caaa07139c8d1bfd848bda29571157799e2abbafe74065e827c01dd29d30f0f1ae3531ac1956aba81cb4f3d4947f9ca99794132989789acb13655645" Warning: password_hash(): Invalid bcrypt cost parameter specified: 3 in /in/3cr4V on line 13 Warning: password_hash(): Invalid bcrypt cost parameter specified: 3 in /in/3cr4V on line 14 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/3cr4V on line 13
Process exited with code 255.
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/3cr4V on line 8
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '[' in /in/3cr4V on line 8
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/3cr4V on line 8
Process exited with code 255.