- microtime: documentation ( source)
<?php
$image = array( 'first', 'second', 'third' );
$str_start = microtime( true );
echo $image['0'] . "\n";
$str_end = ( microtime( true ) - $str_start ) * 1000;
$int_start = microtime( true );
echo $image[0];
$int_end = ( microtime( true ) - $int_start ) * 1000;
echo "\n";
echo 'Time with string: ' . $str_end . "\n";
echo 'Time with int: ' . $int_end;