- 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 < 10000000; ++$i) {
$soFar = '';
$result = [];
foreach (str_split($value) as $char) {
$soFar .= $char;
$result[] = $soFar;
}
}
$end = microtime(true);
echo $i/($end - $start), ' op/s';
var_dump($result);