- var_dump: documentation ( source)
- microtime: documentation ( source)
- hash: documentation ( source)
- asort: documentation ( source)
- hash_algos: documentation ( source)
<?php
$result = [];
foreach(hash_algos() as $algo) {
$start = microtime(true);
$i = 1e6;
while (--$i) {
hash($algo, $i);
}
$result[$algo] = microtime(true) - $start;
}
asort($result);
var_dump($result);