<?php
$ts = microtime(true);
for($i = 1 ; $i <= 10000; $i++):
$array[] = (substr_compare('RouterController', 'Controller', -10));
endfor;
$te = microtime(true);
echo '<br>' . number_format(($te - $ts), 50, ',', ' ');
$ts = microtime(true);
for($i = 1 ; $i <= 10000; $i++):
$array[] = (substr('RouterController', -10) == 'Controller');
endfor;
$te = microtime(true);
echo '<br>' . number_format(($te - $ts), 50, ',', ' ');
preferences:
42.23 ms | 402 KiB | 5 Q