- substr: documentation ( source)
- var_dump: documentation ( source)
- base_convert: documentation ( source)
- hrtime: documentation ( source)
- md5: documentation ( source)
<?php
$menu_slug = "pens-and-pencils";
$menu_title = "Pens and Pencils";
$tests = 10000;
$loop = $tests;
$a = hrtime(1);
while ($loop > 0 ) {
base_convert( substr( md5( $menu_slug . $menu_title ), -4 ), 16, 10 ) * 0.00001;
$loop--;
}
var_dump( hrtime(1) - $a );
$loop = $tests;
$a = hrtime(1);
while ($loop > 0 ) {
substr( base_convert( md5( $menu_slug . $menu_title ), 16, 10 ), -5 ) * 0.00001;
$loop--;
}
var_dump( hrtime(1) - $a );