3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $options = ['cost' => 7,'salt' => 'BCryptRequires22Chrcts']; $hash['hash'][] = password_hash("rasmuslerdorf", PASSWORD_BCRYPT, $options); //"$2y$07$BCryptRequires22Chrcte/VlQH0piJtjXl.0t1XkA8pw9dMXTpOq" $hash['hash'][] = password_hash("rasmuslerdorf", PASSWORD_DEFAULT); //"$2y$10$hHi0De9WN.HL6.Fz1ElvbOMIU5NA0tetwdJzNziKJvHFXFqOxsybi" $hash['info'][] = password_get_info($hash['hash'][0]); //array("algo" => 1 , "algoName" => "bcrypt" , "options" => array("cost" => 7 )) $hash['info'][] = password_get_info($hash['hash'][1]); //array("algo" => 1 , "algoName" => "bcrypt" , "options" => array("cost" => 10 )) $hash['rehash'][] = password_needs_rehash($hash['hash'][0],PASSWORD_BCRYPT,$options); //false $hash['rehash'][] = password_needs_rehash($hash['hash'][0],PASSWORD_DEFAULT); //true $hash['rehash'][] = password_needs_rehash($hash['hash'][1],PASSWORD_DEFAULT); //false $hash['pas_verify'][] = password_verify('rasmuslerdorf', $hash['hash'][0]); //true $hash['pas_verify'][] = password_verify('rasmuslerdorf', $hash['hash'][1]); //true $hash['pas_verify'][] = password_verify('rasmuslerdorff', $hash['hash'][0]); //false $hash['pas_verify'][] = password_verify('rasmuslerdorff', $hash['hash'][1]); //false var_dump($hash); Вывод результата array(4) { ["hash"]=> array(2) { [0] => string(60) "$2y$07$BCryptRequires22Chrcte/VlQH0piJtjXl.0t1XkA8pw9dMXTpOq" [1] => string(60) "$2y$10$CYb5tz9f5IVAgqX7SkIv9ufbi6yYlMQgAHcV4ixXjYSHJZl9KwLrK" } ["info"]=> array(2) { [0]=> array(3) { ["algo"] => int(1) ["algoName" ]=> string(6) "bcrypt" ["options"] => array(1) { ["cost"] => int(7) } } [1]=> array(3) { ["algo"] => int(1) ["algoName"] => string(6) "bcrypt" ["options"] => array(1) { ["cost"] => int(10) } } } ["rehash"]=> array(3) { [0] => bool(false) [1] => bool(true) [2] => bool(false) } ["pas_verify"]=> array(4) { [0] => bool(true) [1] => bool(true) [2] => bool(false) [3] => bool(false) } }
Output for 5.4.0 - 5.4.20
Parse error: syntax error, unexpected 'результата' (T_STRING) in /in/duDAU on line 27
Process exited with code 255.
Output for 5.3.0 - 5.3.27
Parse error: syntax error, unexpected '[' in /in/duDAU on line 3
Process exited with code 255.