3v4l.org

run code in 300+ PHP versions simultaneously
<?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) } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
5.4.200.0100.04312.39
5.4.190.0150.04612.39
5.4.180.0090.04112.39
5.4.170.0090.04412.39
5.4.160.0160.07412.39
5.4.150.0090.04012.39
5.4.140.0100.04512.08
5.4.130.0100.04412.06
5.4.120.0100.04512.03
5.4.110.0090.04712.02
5.4.100.0130.04412.02
5.4.90.0170.05412.02
5.4.80.0110.06112.02
5.4.70.0090.04712.02
5.4.60.0110.04612.02
5.4.50.0120.05212.02
5.4.40.0160.05612.00
5.4.30.0130.03912.00
5.4.20.0100.04012.00
5.4.10.0130.04712.00
5.4.00.0120.04711.50
5.3.270.0110.04912.72
5.3.260.0130.04712.72
5.3.250.0110.04912.72
5.3.240.0130.05212.72
5.3.230.0100.05512.71
5.3.220.0090.05412.68
5.3.210.0090.05312.68
5.3.200.0120.04712.68
5.3.190.0110.04712.68
5.3.180.0100.04712.67
5.3.170.0120.04712.67
5.3.160.0100.04712.67
5.3.150.0130.04512.67
5.3.140.0100.04812.66
5.3.130.0130.05112.66
5.3.120.0080.05612.66
5.3.110.0200.06912.66
5.3.100.0130.05012.12
5.3.90.0120.04812.08
5.3.80.0130.04712.08
5.3.70.0120.04812.08
5.3.60.0150.04712.06
5.3.50.0180.06612.00
5.3.40.0120.06912.00
5.3.30.0110.04911.95
5.3.20.0130.05611.72
5.3.10.0110.05211.69
5.3.00.0140.06111.67

preferences:
184.3 ms | 1394 KiB | 7 Q