- var_dump: documentation ( source)
- password_hash: documentation ( source)
- microtime: documentation ( source)
- password_verify: documentation ( source)
<?php
$input = '3v4l.org is an online shell that allows you to evaluate (hence 3v4l) your code on my server. I compiled more than 100 different PHP versions (every version released since 4.3.0) plus HHVM for you to use. For every script you submit, this site tells you:';
$hash = password_hash($input, PASSWORD_BCRYPT, ['cost' => 8]);
$start = microtime(1);
for($i = 0; $i < 100; $i++) {
password_verify($hash, $input);
}
var_dump(microtime(1)-$start);
$start = microtime(1);
for($i = 0; $i < 100; $i++) {
password_verify($hash, '3v4l.org is an online shell that allows you to evaluate (hence 3v4l) your code on my server. I compiled more than 100 different');
}
var_dump(microtime(1)-$start);