- array_map: documentation ( source)
- var_dump: documentation ( source)
- microtime: documentation ( source)
- base64_encode: documentation ( source)
- str_split: documentation ( source)
- md5: documentation ( source)
<?php
$value = base64_encode(md5(''));
$start = microtime(true);
for ($i = 0; $i < 100; ++$i) {
$soFar = '';
$callback = function ($value) use (&$soFar) {
return $soFar .= $value;
};
$result = array_map($callback, str_split($value));
}
$end = microtime(true);
echo $i/($end - $start), ' op/s';
var_dump($result);