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) { echo decbin(chr(crypt($password, '$2y$07$usesomesillystringforsalt$')[28])), PHP_EOL; } meow('secret'); meow('boegaboe'); meow('42'); meow('Ford Prefect'); meow('Arthur Dent');
Output for 5.4.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" } 0 0 0 0 0
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.3.29
Parse error: syntax error, unexpected '[' in /in/hUADQ on line 13
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/hUADQ on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error in /in/hUADQ on line 13
Process exited with code 255.