3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $pass = 'secret'; $salt = '$2y$07$usesomesillystringforsalt$'; $hash = crypt($pass, $salt); var_dump( $hash, str_split($hash) // the 22th salt character 'e' is on index 28 ); function meow($password) { $hash = crypt($password, '$2y$07$usesomesillystringforsalt$'); $char = substr($hash, 28, 1); $dec = chr($char); $bin = decbin($dec); var_dump( $hash. $char, $dec, $bin ); } meow('secret'); meow('boegaboe'); meow('42'); meow('Ford Prefect'); meow('Arthur Dent');
Output for 5.3.7 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
string(60) "$2y$07$usesomesillystringforex.u2VJUMLRWaJNuw0Hu2FvCEimdeYVO" array(60) { [0]=> string(1) "$" [1]=> string(1) "2" [2]=> string(1) "y" [3]=> string(1) "$" [4]=> string(1) "0" [5]=> string(1) "7" [6]=> string(1) "$" [7]=> string(1) "u" [8]=> string(1) "s" [9]=> string(1) "e" [10]=> string(1) "s" [11]=> string(1) "o" [12]=> string(1) "m" [13]=> string(1) "e" [14]=> string(1) "s" [15]=> string(1) "i" [16]=> string(1) "l" [17]=> string(1) "l" [18]=> string(1) "y" [19]=> string(1) "s" [20]=> string(1) "t" [21]=> string(1) "r" [22]=> string(1) "i" [23]=> string(1) "n" [24]=> string(1) "g" [25]=> string(1) "f" [26]=> string(1) "o" [27]=> string(1) "r" [28]=> string(1) "e" [29]=> string(1) "x" [30]=> string(1) "." [31]=> string(1) "u" [32]=> string(1) "2" [33]=> string(1) "V" [34]=> string(1) "J" [35]=> string(1) "U" [36]=> string(1) "M" [37]=> string(1) "L" [38]=> string(1) "R" [39]=> string(1) "W" [40]=> string(1) "a" [41]=> string(1) "J" [42]=> string(1) "N" [43]=> string(1) "u" [44]=> string(1) "w" [45]=> string(1) "0" [46]=> string(1) "H" [47]=> string(1) "u" [48]=> string(1) "2" [49]=> string(1) "F" [50]=> string(1) "v" [51]=> string(1) "C" [52]=> string(1) "E" [53]=> string(1) "i" [54]=> string(1) "m" [55]=> string(1) "d" [56]=> string(1) "e" [57]=> string(1) "Y" [58]=> string(1) "V" [59]=> string(1) "O" } string(61) "$2y$07$usesomesillystringforex.u2VJUMLRWaJNuw0Hu2FvCEimdeYVOe" string(1) "" string(1) "0" string(61) "$2y$07$usesomesillystringforeFQGkkkdz9UEkja3RbHOL0BvgGXocDzSe" string(1) "" string(1) "0" string(61) "$2y$07$usesomesillystringfore4DMmMTKWiMPYZAqkC/mqG6EX1kaymQye" string(1) "" string(1) "0" string(61) "$2y$07$usesomesillystringforeiyUVcBAcB5WzLTemPVMvfY94ZXlVzoue" string(1) "" string(1) "0" string(61) "$2y$07$usesomesillystringforeKDsABRtsVTJsI8OlMZDJbhgGnkqL4Nme" string(1) "" string(1) "0"
Output for 5.3.2 - 5.3.6
string(13) "$2naUPy3R0iOg" array(13) { [0]=> string(1) "$" [1]=> string(1) "2" [2]=> string(1) "n" [3]=> string(1) "a" [4]=> string(1) "U" [5]=> string(1) "P" [6]=> string(1) "y" [7]=> string(1) "3" [8]=> string(1) "R" [9]=> string(1) "0" [10]=> string(1) "i" [11]=> string(1) "O" [12]=> string(1) "g" } string(13) "$2naUPy3R0iOg" string(1) "" string(1) "0" string(13) "$2LmWtH/q8/sM" string(1) "" string(1) "0" string(13) "$2Pw89Bt7mVdM" string(1) "" string(1) "0" string(13) "$2Tm36EqbAiSk" string(1) "" string(1) "0" string(13) "$2oiDsvhP8z6Q" string(1) "" string(1) "0"
Output for 5.3.0 - 5.3.1
string(13) "$22XjkTaaGJ1Y" array(13) { [0]=> string(1) "$" [1]=> string(1) "2" [2]=> string(1) "2" [3]=> string(1) "X" [4]=> string(1) "j" [5]=> string(1) "k" [6]=> string(1) "T" [7]=> string(1) "a" [8]=> string(1) "a" [9]=> string(1) "G" [10]=> string(1) "J" [11]=> string(1) "1" [12]=> string(1) "Y" } string(13) "$22XjkTaaGJ1Y" string(1) "" string(1) "0" string(13) "$2kr0cAtoDi/g" string(1) "" string(1) "0" string(13) "$2n03Ga/MEzWo" string(1) "" string(1) "0" string(13) "$290sAoI/M60A" string(1) "" string(1) "0" string(13) "$2JXqVebq.qK6" string(1) "" string(1) "0"
Output for 4.3.0 - 5.2.17

Process exited with code 139.