SubstrExtensionTest

Obtain filename extension with substr/strrchr


<?php 

$this
->start($loop);

$file '/tmp/'.uniqid().'.jpg';

for (
$i 0$i $this->loop; ++$i) {
    
$value strtolower(substr(strrchr($file'.'), 1));
}

return 
$this->end();
PHP Loops Seconds Percent
8.0.30 10.000 0.001957 100%
8.0.30 100.000 0.018230 100%
8.0.9 100.000 0.015204 100%
8.0.8 100.000 0.020546 100%
7.3.13 100.000 0.021888 100%
7.3.12 100.000 0.019827 100%
7.3.11 100.000 0.015480 100%
7.2.34 100.000 0.019377 100%
7.2.33 100.000 0.020157 100%
7.2.31 100.000 0.020522 100%
7.2.30 100.000 0.020390 100%
7.2.29 100.000 0.019800 100%
7.2.28 100.000 0.021554 100%
7.2.27 100.000 0.023209 100%
7.2.26 100.000 0.024189 100%
7.2.25 100.000 0.019742 100%
7.2.24 100.000 0.017979 100%
7.2.22 100.000 0.021430 100%
7.2.21 100.000 0.020340 100%
7.1.33 100.000 0.025393 100%
7.1.32 100.000 0.032967 100%
7.1.31 100.000 0.030001 100%
7.1.0 100.000 0.147375 100%
7.0.33 100.000 0.025572 100%
7.0.7 100.000 0.142576 100%
5.6.40 100.000 0.054755 100%
5.6.22 100.000 0.307272 100%
5.5.36 100.000 0.332157 100%
5.4.45 100.000 0.347990 100%
5.3.29 100.000 0.402298 100%
8.0.29 10.000 0.001233 100%
8.0.29 100.000 0.013119 100%
8.0.28 100.000 0.014202 100%
8.0.27 100.000 0.015788 100%
8.0.26 100.000 0.015437 100%
8.0.25 100.000 0.016387 100%
8.0.24 100.000 0.015713 100%
8.0.23 100.000 0.015616 100%
8.0.20 100.000 0.013344 100%
8.0.19 100.000 0.019426 100%
8.0.17 100.000 0.019823 100%
8.0.16 100.000 0.017746 100%
8.0.14 100.000 0.018427 100%
8.0.11 10.000 0.001961 100%
8.0.11 100.000 0.017091 100%
8.0.10 10.000 0.002009 100%
8.0.10 100.000 0.017240 100%
7.3.15 100.000 0.017053 100%
8.0.28 10.000 0.001480 100%
8.0.27 10.000 0.001990 100%
8.0.26 10.000 0.001511 100%
8.0.25 10.000 0.001629 100%
8.0.24 10.000 0.001667 100%
8.0.23 10.000 0.001838 100%
8.0.20 10.000 0.001342 100%
8.0.19 10.000 0.001789 100%
8.0.17 10.000 0.001915 100%
8.0.16 10.000 0.002423 100%
8.0.14 10.000 0.002089 100%
7.3.14 100.000 0.022363 100%
8.0.9 10.000 0.001635 100%
8.0.7 100.000 0.021037 100%
8.0.8 10.000 0.001854 100%
8.0.3 100.000 0.021820 100%
8.0.2 100.000 0.024741 100%
8.0.0 100.000 0.017491 100%
7.4.33 100.000 0.016303 100%
8.0.7 10.000 0.001925 100%
7.4.32 100.000 0.015886 100%
7.4.30 100.000 0.013779 100%
7.4.29 100.000 0.019921 100%
7.4.27 100.000 0.018278 100%
8.0.3 10.000 0.002709 100%
7.4.28 100.000 0.019241 100%
7.4.24 100.000 0.017209 100%
7.4.7 100.000 0.018479 100%
7.4.6 100.000 0.018517 100%
7.4.5 100.000 0.018920 100%
7.4.4 100.000 0.020254 100%
8.0.2 10.000 0.003261 100%
8.0.0 10.000 0.002124 100%
7.4.3 100.000 0.018868 100%
7.4.33 10.000 0.001807 100%
7.4.32 10.000 0.001825 100%
7.4.30 10.000 0.001509 100%
7.4.29 10.000 0.002040 100%
7.3.17 100.000 0.020712 100%
7.3.16 100.000 0.019841 100%
7.4.28 10.000 0.002034 100%
7.4.23 100.000 0.017498 100%
7.4.21 100.000 0.021250 100%
7.4.20 100.000 0.019811 100%
7.4.24 10.000 0.001954 100%
7.4.16 100.000 0.023373 100%
7.4.15 10.000 0.003441 100%
7.4.15 100.000 0.026263 100%
7.4.13 100.000 0.017462 100%
7.4.27 10.000 0.002149 100%
7.4.23 10.000 0.001787 100%
7.4.22 10.000 0.001957 100%
7.4.22 100.000 0.018331 100%
7.4.21 10.000 0.002004 100%
7.4.20 10.000 0.002234 100%
7.4.16 10.000 0.002569 100%
7.4.13 10.000 0.001951 100%
7.4.12 10.000 0.002314 100%
7.4.12 100.000 0.016476 100%
7.4.11 100.000 0.015808 100%
7.4.11 10.000 0.001952 100%
7.4.10 10.000 0.002020 100%
7.4.10 100.000 0.018342 100%
7.4.7 10.000 0.002111 100%
7.4.6 10.000 0.002100 100%
7.4.5 10.000 0.002231 100%
7.4.4 10.000 0.001729 100%
7.4.2 10.000 0.002347 100%
7.4.2 100.000 0.020364 100%
7.4.3 10.000 0.002071 100%
7.4.1 10.000 0.002026 100%
7.4.1 100.000 0.021044 100%
7.4.0 100.000 0.015847 100%
7.3.33 100.000 0.016819 100%
7.3.31 100.000 0.018381 100%
7.3.18 100.000 0.019229 100%
7.3.33 10.000 0.001842 100%
7.3.30 100.000 0.018242 100%
7.4.0 10.000 0.001757 100%
7.3.31 10.000 0.002045 100%
7.3.29 10.000 0.001787 100%
7.3.29 100.000 0.017582 100%
7.3.28 10.000 0.002137 100%
7.3.28 100.000 0.020346 100%
7.3.27 10.000 0.003032 100%
7.3.27 100.000 0.024310 100%
7.3.30 10.000 0.001986 100%
7.3.24 10.000 0.002073 100%
7.3.24 100.000 0.017526 100%
7.3.23 10.000 0.002265 100%
7.3.23 100.000 0.019761 100%
7.3.22 10.000 0.002343 100%
7.3.22 100.000 0.018177 100%
7.3.19 10.000 0.002545 100%
7.3.19 100.000 0.018192 100%
7.3.18 10.000 0.002606 100%
7.3.17 10.000 0.002286 100%
7.3.9 10.000 0.001997 100%
7.3.9 100.000 0.018115 100%
7.3.8 10.000 0.001707 100%
7.3.8 100.000 0.016626 100%
7.3.16 10.000 0.001772 100%
7.3.15 10.000 0.002319 100%
7.3.14 10.000 0.002599 100%
7.3.13 10.000 0.002105 100%
7.3.12 10.000 0.002137 100%
7.3.11 10.000 0.001808 100%
7.2.34 10.000 0.002281 100%
7.2.33 10.000 0.002306 100%
7.2.31 10.000 0.002521 100%
7.2.30 10.000 0.001953 100%
7.2.29 10.000 0.002265 100%
7.2.28 10.000 0.002541 100%
7.2.27 10.000 0.003055 100%
7.2.26 10.000 0.002734 100%
7.2.25 10.000 0.002136 100%
7.2.24 10.000 0.001958 100%
7.2.22 10.000 0.002292 100%
7.2.21 10.000 0.002131 100%
7.1.33 10.000 0.003261 100%
7.1.32 10.000 0.003989 100%
7.1.31 10.000 0.003274 100%
7.1.0 10.000 0.015365 100%
7.0.33 10.000 0.003264 100%
7.0.7 10.000 0.015002 100%
5.6.40 10.000 0.007790 100%
5.6.22 10.000 0.031761 100%
5.5.36 10.000 0.034742 100%
5.4.45 10.000 0.036167 100%
5.3.29 10.000 0.045156 100%

PathinfoExtensionTest

Obtain filename extension with pathinfo


<?php 

$this
->start($loop);

$file '/tmp/'.uniqid().'.jpg';

for (
$i 0$i $this->loop; ++$i) {
    
$value strtolower(pathinfo($filePATHINFO_EXTENSION));
}

return 
$this->end();
PHP Loops Seconds Percent
8.0.30 10.000 0.012891 +659%
8.0.30 100.000 0.090253 +495%
8.0.9 100.000 0.093544 +615%
8.0.8 100.000 0.118480 +577%
7.3.13 100.000 0.086098 +393%
7.3.12 100.000 0.082651 +417%
7.3.11 100.000 0.100232 +648%
7.2.34 100.000 0.090893 +469%
7.2.33 100.000 0.092284 +458%
7.2.31 100.000 0.092877 +453%
7.2.30 100.000 0.089291 +438%
7.2.29 100.000 0.088567 +447%
7.2.28 100.000 0.092411 +429%
7.2.27 100.000 0.098527 +425%
7.2.26 100.000 0.093709 +387%
7.2.25 100.000 0.084163 +426%
7.2.24 100.000 0.098803 +550%
7.2.22 100.000 0.121459 +567%
7.2.21 100.000 0.119639 +588%
7.1.33 100.000 0.096813 +381%
7.1.32 100.000 0.126720 +384%
7.1.31 100.000 0.126572 +422%
7.1.0 100.000 0.346409 +235%
7.0.33 100.000 0.098804 +386%
7.0.7 100.000 0.334298 +234%
5.6.40 100.000 0.126171 +230%
5.6.22 100.000 0.489942 +159%
5.5.36 100.000 0.567422 +171%
5.4.45 100.000 0.551170 +158%
5.3.29 100.000 0.731934 +182%
8.0.29 10.000 0.008661 +702%
8.0.29 100.000 0.077406 +590%
8.0.28 100.000 0.075548 +532%
8.0.27 100.000 0.079777 +505%
8.0.26 100.000 0.080418 +521%
8.0.25 100.000 0.075568 +461%
8.0.24 100.000 0.075196 +479%
8.0.23 100.000 0.078425 +502%
8.0.20 100.000 0.077225 +579%
8.0.19 100.000 0.081811 +421%
8.0.17 100.000 0.088623 +447%
8.0.16 100.000 0.084675 +477%
8.0.14 100.000 0.090697 +492%
8.0.11 10.000 0.013409 +684%
8.0.11 100.000 0.081230 +475%
8.0.10 10.000 0.013517 +673%
8.0.10 100.000 0.080948 +470%
7.3.15 100.000 0.086117 +505%
8.0.28 10.000 0.010022 +677%
8.0.27 10.000 0.011448 +575%
8.0.26 10.000 0.012939 +856%
8.0.25 10.000 0.011053 +679%
8.0.24 10.000 0.009584 +575%
8.0.23 10.000 0.009214 +501%
8.0.20 10.000 0.009360 +698%
8.0.19 10.000 0.013012 +727%
8.0.17 10.000 0.012843 +671%
8.0.16 10.000 0.013252 +547%
8.0.14 10.000 0.013852 +663%
7.3.14 100.000 0.090421 +404%
8.0.9 10.000 0.013118 +802%
8.0.7 100.000 0.082498 +392%
8.0.8 10.000 0.012429 +670%
8.0.3 100.000 0.102090 +468%
8.0.2 100.000 0.119326 +482%
8.0.0 100.000 0.087185 +498%
7.4.33 100.000 0.086042 +528%
8.0.7 10.000 0.015659 +813%
7.4.32 100.000 0.079514 +501%
7.4.30 100.000 0.082130 +596%
7.4.29 100.000 0.086526 +434%
7.4.27 100.000 0.088597 +485%
8.0.3 10.000 0.016233 +599%
7.4.28 100.000 0.090805 +472%
7.4.24 100.000 0.086486 +503%
7.4.7 100.000 0.089956 +487%
7.4.6 100.000 0.087939 +475%
7.4.5 100.000 0.086903 +459%
7.4.4 100.000 0.086584 +427%
8.0.2 10.000 0.017731 +544%
8.0.0 10.000 0.013554 +638%
7.4.3 100.000 0.082354 +436%
7.4.33 10.000 0.011275 +624%
7.4.32 10.000 0.010505 +575%
7.4.30 10.000 0.011088 +735%
7.4.29 10.000 0.015470 +758%
7.3.17 100.000 0.084482 +408%
7.3.16 100.000 0.088535 +446%
7.4.28 10.000 0.013679 +672%
7.4.23 100.000 0.090776 +519%
7.4.21 100.000 0.091535 +431%
7.4.20 100.000 0.087141 +440%
7.4.24 10.000 0.012984 +665%
7.4.16 100.000 0.106543 +456%
7.4.15 10.000 0.025756 +749%
7.4.15 100.000 0.132653 +505%
7.4.13 100.000 0.086432 +495%
7.4.27 10.000 0.014168 +659%
7.4.23 10.000 0.013752 +770%
7.4.22 10.000 0.014031 +717%
7.4.22 100.000 0.082814 +452%
7.4.21 10.000 0.015094 +753%
7.4.20 10.000 0.014409 +645%
7.4.16 10.000 0.017113 +666%
7.4.13 10.000 0.013216 +677%
7.4.12 10.000 0.012510 +541%
7.4.12 100.000 0.103048 +625%
7.4.11 100.000 0.099959 +632%
7.4.11 10.000 0.012596 +645%
7.4.10 10.000 0.013487 +668%
7.4.10 100.000 0.083920 +458%
7.4.7 10.000 0.013797 +653%
7.4.6 10.000 0.015319 +730%
7.4.5 10.000 0.014329 +642%
7.4.4 10.000 0.013570 +785%
7.4.2 10.000 0.015773 +672%
7.4.2 100.000 0.088796 +436%
7.4.3 10.000 0.013641 +659%
7.4.1 10.000 0.016418 +810%
7.4.1 100.000 0.088799 +422%
7.4.0 100.000 0.108346 +684%
7.3.33 100.000 0.085916 +511%
7.3.31 100.000 0.082633 +450%
7.3.18 100.000 0.087247 +454%
7.3.33 10.000 0.011782 +639%
7.3.30 100.000 0.082384 +452%
7.4.0 10.000 0.013026 +742%
7.3.31 10.000 0.013667 +668%
7.3.29 10.000 0.011854 +663%
7.3.29 100.000 0.082523 +469%
7.3.28 10.000 0.014898 +697%
7.3.28 100.000 0.083270 +409%
7.3.27 10.000 0.017300 +571%
7.3.27 100.000 0.107681 +443%
7.3.30 10.000 0.014437 +727%
7.3.24 10.000 0.012879 +621%
7.3.24 100.000 0.091794 +524%
7.3.23 10.000 0.015241 +673%
7.3.23 100.000 0.093163 +471%
7.3.22 10.000 0.014935 +637%
7.3.22 100.000 0.093666 +515%
7.3.19 10.000 0.014774 +581%
7.3.19 100.000 0.093282 +513%
7.3.18 10.000 0.013314 +511%
7.3.17 10.000 0.013502 +591%
7.3.9 10.000 0.013283 +665%
7.3.9 100.000 0.114903 +634%
7.3.8 10.000 0.012342 +723%
7.3.8 100.000 0.114667 +690%
7.3.16 10.000 0.013016 +735%
7.3.15 10.000 0.013189 +569%
7.3.14 10.000 0.016585 +638%
7.3.13 10.000 0.016235 +771%
7.3.12 10.000 0.014139 +662%
7.3.11 10.000 0.011324 +626%
7.2.34 10.000 0.012737 +558%
7.2.33 10.000 0.012859 +558%
7.2.31 10.000 0.014920 +592%
7.2.30 10.000 0.014543 +745%
7.2.29 10.000 0.013883 +613%
7.2.28 10.000 0.013888 +546%
7.2.27 10.000 0.017342 +568%
7.2.26 10.000 0.017253 +631%
7.2.25 10.000 0.014745 +690%
7.2.24 10.000 0.011917 +609%
7.2.22 10.000 0.014172 +618%
7.2.21 10.000 0.012781 +600%
7.1.33 10.000 0.014183 +435%
7.1.32 10.000 0.014109 +354%
7.1.31 10.000 0.013476 +412%
7.1.0 10.000 0.036450 +237%
7.0.33 10.000 0.014172 +434%
7.0.7 10.000 0.035616 +237%
5.6.40 10.000 0.017054 +219%
5.6.22 10.000 0.051457 +162%
5.5.36 10.000 0.057179 +165%
5.4.45 10.000 0.056120 +155%
5.3.29 10.000 0.079160 +175%