<?php
function str_contains_eval( $show = '' ) {
$url = true;
if ( ! str_contains( $show, 'url' )
&& ! str_contains( $show, 'directory' )
&& ! str_contains( $show, 'home' )
) {
$url = false;
}
if ( $url ) {}
}
function preg_match_eval( $show = '' ) {
if ( preg_match( '/url|directory|home/', $show ) ) {}
}
$its = 1e3;
$t = hrtime(true);
for ( $i=0;$i++<$its;)
$z = str_contains_eval( 'blogname' );
echo (hrtime(true)-$t)/1e9,"s\n";
$t = hrtime(true);
for ( $i=0;$i++<$its;)
$z = preg_match_eval( 'blogname' );
echo (hrtime(true)-$t)/1e9,"s\n";
echo "\n=== Warmed up ===\n\n";
$its = 1e5;
$t = hrtime(true);
for ( $i=0;$i++<$its;)
$z = str_contains_eval( 'blogname' );
echo 'str_contains chain: ', $a=(hrtime(true)-$t)/1e9,"s\n";
$t = hrtime(true);
for ( $i=0;$i++<$its;)
$z = preg_match_eval( 'blogname' );
echo 'preg_match : ', $b=(hrtime(true)-$t)/1e9,"s\n";
echo 'preg_match is ', number_format((($a-$b)/$a) * 100, 2 ), "% faster than str_contains chain\n";
- Output for 8.4.2
- 0.000130789s
0.000266348s
=== Warmed up ===
str_contains chain: 0.014052867s
preg_match : 0.009343574s
preg_match is 33.51% faster than str_contains chain
- Output for 8.4.1
- 0.000188088s
0.000196928s
=== Warmed up ===
str_contains chain: 0.011231612s
preg_match : 0.009191801s
preg_match is 18.16% faster than str_contains chain
- Output for 8.3.15
- 0.000184058s
0.000249387s
=== Warmed up ===
str_contains chain: 0.014503767s
preg_match : 0.007281978s
preg_match is 49.79% faster than str_contains chain
- Output for 8.3.14
- 0.000170839s
0.000284996s
=== Warmed up ===
str_contains chain: 0.016188022s
preg_match : 0.00758773s
preg_match is 53.13% faster than str_contains chain
- Output for 8.3.13
- 7.2299E-5s
0.000107692s
=== Warmed up ===
str_contains chain: 0.006338478s
preg_match : 0.005027575s
preg_match is 20.68% faster than str_contains chain
- Output for 8.3.12
- 7.265E-5s
0.000108644s
=== Warmed up ===
str_contains chain: 0.006554855s
preg_match : 0.005034409s
preg_match is 23.20% faster than str_contains chain
- Output for 8.3.11
- 7.1228E-5s
0.000101662s
=== Warmed up ===
str_contains chain: 0.006665515s
preg_match : 0.005082848s
preg_match is 23.74% faster than str_contains chain
- Output for 8.3.10
- 6.9615E-5s
0.000110646s
=== Warmed up ===
str_contains chain: 0.00671222s
preg_match : 0.005151577s
preg_match is 23.25% faster than str_contains chain
- Output for 8.3.9
- 6.7713E-5s
0.000115623s
=== Warmed up ===
str_contains chain: 0.006682106s
preg_match : 0.005297403s
preg_match is 20.72% faster than str_contains chain
- Output for 8.3.8
- 0.000140363s
0.000166332s
=== Warmed up ===
str_contains chain: 0.012125621s
preg_match : 0.00900718s
preg_match is 25.72% faster than str_contains chain
- Output for 8.3.7
- 0.000157667s
0.000247723s
=== Warmed up ===
str_contains chain: 0.016231089s
preg_match : 0.014418147s
preg_match is 11.17% faster than str_contains chain
- Output for 8.3.6
- 0.000129856s
0.000200362s
=== Warmed up ===
str_contains chain: 0.012873525s
preg_match : 0.00971697s
preg_match is 24.52% faster than str_contains chain
- Output for 8.3.5
- 0.000131499s
0.000197998s
=== Warmed up ===
str_contains chain: 0.013147578s
preg_match : 0.009570515s
preg_match is 27.21% faster than str_contains chain
- Output for 8.3.4
- 0.000170447s
0.000171959s
=== Warmed up ===
str_contains chain: 0.012345396s
preg_match : 0.009524844s
preg_match is 22.85% faster than str_contains chain
- Output for 8.3.3
- 0.000129525s
0.000175344s
=== Warmed up ===
str_contains chain: 0.012195951s
preg_match : 0.009587135s
preg_match is 21.39% faster than str_contains chain
- Output for 8.3.2
- 6.8414E-5s
0.000119429s
=== Warmed up ===
str_contains chain: 0.007032781s
preg_match : 0.005160427s
preg_match is 26.62% faster than str_contains chain
- Output for 8.3.1
- 6.8763E-5s
9.7026E-5s
=== Warmed up ===
str_contains chain: 0.006668266s
preg_match : 0.00527022s
preg_match is 20.97% faster than str_contains chain
- Output for 8.3.0
- 6.3435E-5s
9.8028E-5s
=== Warmed up ===
str_contains chain: 0.006622443s
preg_match : 0.005132769s
preg_match is 22.49% faster than str_contains chain
- Output for 8.2.27
- 0.000173248s
0.000215899s
=== Warmed up ===
str_contains chain: 0.016421755s
preg_match : 0.012421145s
preg_match is 24.36% faster than str_contains chain
- Output for 8.2.26
- 0.000126939s
0.000186508s
=== Warmed up ===
str_contains chain: 0.007880535s
preg_match : 0.004991256s
preg_match is 36.66% faster than str_contains chain
- Output for 8.2.25
- 7.8448E-5s
0.000104938s
=== Warmed up ===
str_contains chain: 0.006365942s
preg_match : 0.005101885s
preg_match is 19.86% faster than str_contains chain
- Output for 8.2.24
- 0.00016592s
0.000295906s
=== Warmed up ===
str_contains chain: 0.017351041s
preg_match : 0.013192418s
preg_match is 23.97% faster than str_contains chain
- Output for 8.2.23
- 6.5949E-5s
0.000120491s
=== Warmed up ===
str_contains chain: 0.006720829s
preg_match : 0.005133173s
preg_match is 23.62% faster than str_contains chain
- Output for 8.2.22
- 6.7442E-5s
0.000101824s
=== Warmed up ===
str_contains chain: 0.006534593s
preg_match : 0.005225224s
preg_match is 20.04% faster than str_contains chain
- Output for 8.2.21
- 6.1903E-5s
9.962E-5s
=== Warmed up ===
str_contains chain: 0.006617272s
preg_match : 0.005983147s
preg_match is 9.58% faster than str_contains chain
- Output for 8.2.20
- 8.7103E-5s
0.000174706s
=== Warmed up ===
str_contains chain: 0.008929843s
preg_match : 0.00680835s
preg_match is 23.76% faster than str_contains chain
- Output for 8.2.19
- 0.000177637s
0.000427435s
=== Warmed up ===
str_contains chain: 0.018149714s
preg_match : 0.013977707s
preg_match is 22.99% faster than str_contains chain
- Output for 8.2.18
- 0.000261594s
0.000363587s
=== Warmed up ===
str_contains chain: 0.021585753s
preg_match : 0.012725175s
preg_match is 41.05% faster than str_contains chain
- Output for 8.2.17
- 0.000124747s
0.0001993s
=== Warmed up ===
str_contains chain: 0.012600371s
preg_match : 0.009484226s
preg_match is 24.73% faster than str_contains chain
- Output for 8.2.16
- 0.000126079s
0.000182685s
=== Warmed up ===
str_contains chain: 0.013506923s
preg_match : 0.010078183s
preg_match is 25.39% faster than str_contains chain
- Output for 8.2.15
- 0.000111217s
0.000131377s
=== Warmed up ===
str_contains chain: 0.006036686s
preg_match : 0.005234612s
preg_match is 13.29% faster than str_contains chain
- Output for 8.2.14
- 6.9324E-5s
0.000111418s
=== Warmed up ===
str_contains chain: 0.006601883s
preg_match : 0.00524524s
preg_match is 20.55% faster than str_contains chain
- Output for 8.2.13
- 6.4458E-5s
9.2419E-5s
=== Warmed up ===
str_contains chain: 0.006616242s
preg_match : 0.005152608s
preg_match is 22.12% faster than str_contains chain
- Output for 8.2.12
- 7.6997E-5s
0.000111978s
=== Warmed up ===
str_contains chain: 0.006451273s
preg_match : 0.005301642s
preg_match is 17.82% faster than str_contains chain
- Output for 8.2.11
- 0.000114582s
0.000125138s
=== Warmed up ===
str_contains chain: 0.011304974s
preg_match : 0.007895405s
preg_match is 30.16% faster than str_contains chain
- Output for 8.2.10
- 0.000101611s
0.000162576s
=== Warmed up ===
str_contains chain: 0.009195422s
preg_match : 0.007400074s
preg_match is 19.52% faster than str_contains chain
- Output for 8.2.9
- 9.7875E-5s
0.000176943s
=== Warmed up ===
str_contains chain: 0.008762408s
preg_match : 0.007356292s
preg_match is 16.05% faster than str_contains chain
- Output for 8.2.8
- 9.7815E-5s
0.000167545s
=== Warmed up ===
str_contains chain: 0.008764653s
preg_match : 0.007726158s
preg_match is 11.85% faster than str_contains chain
- Output for 8.2.7
- 0.000119235s
0.000147277s
=== Warmed up ===
str_contains chain: 0.009400108s
preg_match : 0.007505763s
preg_match is 20.15% faster than str_contains chain
- Output for 8.2.6
- 9.9017E-5s
0.000171112s
=== Warmed up ===
str_contains chain: 0.009161739s
preg_match : 0.007218703s
preg_match is 21.21% faster than str_contains chain
- Output for 8.2.5
- 9.8695E-5s
0.00015384s
=== Warmed up ===
str_contains chain: 0.00884343s
preg_match : 0.008125328s
preg_match is 8.12% faster than str_contains chain
- Output for 8.2.4
- 0.000102142s
0.000162756s
=== Warmed up ===
str_contains chain: 0.00904039s
preg_match : 0.007743419s
preg_match is 14.35% faster than str_contains chain
- Output for 8.2.3
- 9.3776E-5s
0.000141977s
=== Warmed up ===
str_contains chain: 0.008450531s
preg_match : 0.009495266s
preg_match is -12.36% faster than str_contains chain
- Output for 8.2.2
- 9.8976E-5s
0.0001536s
=== Warmed up ===
str_contains chain: 0.009007307s
preg_match : 0.007498831s
preg_match is 16.75% faster than str_contains chain
- Output for 8.2.1
- 0.000108414s
0.000146967s
=== Warmed up ===
str_contains chain: 0.009593702s
preg_match : 0.008220268s
preg_match is 14.32% faster than str_contains chain
- Output for 8.2.0
- 0.000105719s
0.000141787s
=== Warmed up ===
str_contains chain: 0.010496742s
preg_match : 0.007138862s
preg_match is 31.99% faster than str_contains chain
- Output for 8.1.31
- 6.4529E-5s
0.000127669s
=== Warmed up ===
str_contains chain: 0.006760547s
preg_match : 0.005549601s
preg_match is 17.91% faster than str_contains chain
- Output for 8.1.30
- 6.5228E-5s
0.000105079s
=== Warmed up ===
str_contains chain: 0.006934113s
preg_match : 0.005148288s
preg_match is 25.75% faster than str_contains chain
- Output for 8.1.29
- 8.4829E-5s
0.000124213s
=== Warmed up ===
str_contains chain: 0.008071025s
preg_match : 0.006728311s
preg_match is 16.64% faster than str_contains chain
- Output for 8.1.28
- 0.000147272s
0.000249537s
=== Warmed up ===
str_contains chain: 0.015629045s
preg_match : 0.009320027s
preg_match is 40.37% faster than str_contains chain
- Output for 8.1.27
- 7.1797E-5s
9.1537E-5s
=== Warmed up ===
str_contains chain: 0.007203723s
preg_match : 0.005117229s
preg_match is 28.96% faster than str_contains chain
- Output for 8.1.26
- 8.4868E-5s
9.1146E-5s
=== Warmed up ===
str_contains chain: 0.006633225s
preg_match : 0.005066507s
preg_match is 23.62% faster than str_contains chain
- Output for 8.1.25
- 6.7132E-5s
9.5122E-5s
=== Warmed up ===
str_contains chain: 0.006658487s
preg_match : 0.005143025s
preg_match is 22.76% faster than str_contains chain
- Output for 8.1.24
- 0.00011305s
0.000135032s
=== Warmed up ===
str_contains chain: 0.011206653s
preg_match : 0.007979904s
preg_match is 28.79% faster than str_contains chain
- Output for 8.1.23
- 9.3786E-5s
0.000153058s
=== Warmed up ===
str_contains chain: 0.008600421s
preg_match : 0.008831297s
preg_match is -2.68% faster than str_contains chain
- Output for 8.1.22
- 0.000102583s
0.00020235s
=== Warmed up ===
str_contains chain: 0.008821439s
preg_match : 0.008549146s
preg_match is 3.09% faster than str_contains chain
- Output for 8.1.21
- 9.6593E-5s
0.000140004s
=== Warmed up ===
str_contains chain: 0.008923171s
preg_match : 0.007100951s
preg_match is 20.42% faster than str_contains chain
- Output for 8.1.20
- 0.000124926s
0.000192782s
=== Warmed up ===
str_contains chain: 0.008921988s
preg_match : 0.006969814s
preg_match is 21.88% faster than str_contains chain
- Output for 8.1.19
- 9.8154E-5s
0.000161234s
=== Warmed up ===
str_contains chain: 0.008861645s
preg_match : 0.007065535s
preg_match is 20.27% faster than str_contains chain
- Output for 8.1.18
- 9.8445E-5s
0.0002344s
=== Warmed up ===
str_contains chain: 0.008868277s
preg_match : 0.007939589s
preg_match is 10.47% faster than str_contains chain
- Output for 8.1.17
- 9.7093E-5s
0.000264879s
=== Warmed up ===
str_contains chain: 0.009625992s
preg_match : 0.007233722s
preg_match is 24.85% faster than str_contains chain
- Output for 8.1.16
- 0.00010107s
0.000177493s
=== Warmed up ===
str_contains chain: 0.008759072s
preg_match : 0.007025599s
preg_match is 19.79% faster than str_contains chain
- Output for 8.1.15
- 9.014E-5s
0.000146887s
=== Warmed up ===
str_contains chain: 0.008357987s
preg_match : 0.0069669s
preg_match is 16.64% faster than str_contains chain
- Output for 8.1.14
- 0.000101109s
0.000192322s
=== Warmed up ===
str_contains chain: 0.009364851s
preg_match : 0.008285701s
preg_match is 11.52% faster than str_contains chain
- Output for 8.1.13
- 0.000100349s
0.000174598s
=== Warmed up ===
str_contains chain: 0.008767617s
preg_match : 0.00839729s
preg_match is 4.22% faster than str_contains chain
- Output for 8.1.12
- 0.000106882s
0.000154751s
=== Warmed up ===
str_contains chain: 0.009585297s
preg_match : 0.008687567s
preg_match is 9.37% faster than str_contains chain
- Output for 8.1.11
- 0.000105988s
0.000187713s
=== Warmed up ===
str_contains chain: 0.009434784s
preg_match : 0.006932744s
preg_match is 26.52% faster than str_contains chain
- Output for 8.1.10
- 9.7584E-5s
0.000158167s
=== Warmed up ===
str_contains chain: 0.008938069s
preg_match : 0.006997306s
preg_match is 21.71% faster than str_contains chain
- Output for 8.1.9
- 0.000100138s
0.000176602s
=== Warmed up ===
str_contains chain: 0.008952144s
preg_match : 0.008446884s
preg_match is 5.64% faster than str_contains chain
- Output for 8.1.8
- 9.7443E-5s
0.000157857s
=== Warmed up ===
str_contains chain: 0.008742091s
preg_match : 0.007060454s
preg_match is 19.24% faster than str_contains chain
- Output for 8.1.7
- 0.000103495s
0.000179547s
=== Warmed up ===
str_contains chain: 0.009293638s
preg_match : 0.008187365s
preg_match is 11.90% faster than str_contains chain
- Output for 8.1.6
- 9.6382E-5s
0.00019651s
=== Warmed up ===
str_contains chain: 0.008819926s
preg_match : 0.008578522s
preg_match is 2.74% faster than str_contains chain
- Output for 8.1.5
- 8.4099E-5s
0.000195948s
=== Warmed up ===
str_contains chain: 0.008222422s
preg_match : 0.010102509s
preg_match is -22.87% faster than str_contains chain
- Output for 8.1.4
- 8.9038E-5s
0.000175781s
=== Warmed up ===
str_contains chain: 0.009219207s
preg_match : 0.009936557s
preg_match is -7.78% faster than str_contains chain
- Output for 8.1.3
- 9.8827E-5s
0.000190248s
=== Warmed up ===
str_contains chain: 0.009047404s
preg_match : 0.008264931s
preg_match is 8.65% faster than str_contains chain
- Output for 8.1.2
- 0.000123673s
0.000207742s
=== Warmed up ===
str_contains chain: 0.012037279s
preg_match : 0.009232412s
preg_match is 23.30% faster than str_contains chain
- Output for 8.1.1
- 8.9908E-5s
0.000243317s
=== Warmed up ===
str_contains chain: 0.009107366s
preg_match : 0.008374789s
preg_match is 8.04% faster than str_contains chain
- Output for 8.1.0
- 9.058E-5s
0.000185499s
=== Warmed up ===
str_contains chain: 0.009595605s
preg_match : 0.008433328s
preg_match is 12.11% faster than str_contains chain
- Output for 8.0.30
- 0.000134734s
0.000167545s
=== Warmed up ===
str_contains chain: 0.009491319s
preg_match : 0.008007467s
preg_match is 15.63% faster than str_contains chain
- Output for 8.0.29
- 0.001326256s
0.000152407s
=== Warmed up ===
str_contains chain: 0.009293026s
preg_match : 0.007895226s
preg_match is 15.04% faster than str_contains chain
- Output for 8.0.28
- 0.001299414s
0.000151946s
=== Warmed up ===
str_contains chain: 0.009555129s
preg_match : 0.007873546s
preg_match is 17.60% faster than str_contains chain
- Output for 8.0.27
- 0.001414732s
0.00019097s
=== Warmed up ===
str_contains chain: 0.009311641s
preg_match : 0.007049364s
preg_match is 24.30% faster than str_contains chain
- Output for 8.0.26
- 0.00138157s
0.00018087s
=== Warmed up ===
str_contains chain: 0.010134048s
preg_match : 0.007709016s
preg_match is 23.93% faster than str_contains chain
- Output for 8.0.25
- 0.001284086s
0.000145303s
=== Warmed up ===
str_contains chain: 0.009018449s
preg_match : 0.007389584s
preg_match is 18.06% faster than str_contains chain
- Output for 8.0.24
- 0.001419692s
0.000201709s
=== Warmed up ===
str_contains chain: 0.009046642s
preg_match : 0.008172508s
preg_match is 9.66% faster than str_contains chain
- Output for 8.0.23
- 0.000104838s
0.00014882s
=== Warmed up ===
str_contains chain: 0.009845916s
preg_match : 0.00771691s
preg_match is 21.62% faster than str_contains chain
- Output for 8.0.22
- 0.000101711s
0.00015367s
=== Warmed up ===
str_contains chain: 0.009281614s
preg_match : 0.007519238s
preg_match is 18.99% faster than str_contains chain
- Output for 8.0.21
- 0.00015398s
0.000197421s
=== Warmed up ===
str_contains chain: 0.009230528s
preg_match : 0.007266031s
preg_match is 21.28% faster than str_contains chain
- Output for 8.0.20
- 0.000118964s
0.000205255s
=== Warmed up ===
str_contains chain: 0.009541113s
preg_match : 0.007305145s
preg_match is 23.44% faster than str_contains chain
- Output for 8.0.19
- 0.000131367s
0.000209413s
=== Warmed up ===
str_contains chain: 0.009597679s
preg_match : 0.007353487s
preg_match is 23.38% faster than str_contains chain
- Output for 8.0.18
- 0.000106701s
0.000233129s
=== Warmed up ===
str_contains chain: 0.010139058s
preg_match : 0.007887902s
preg_match is 22.20% faster than str_contains chain
- Output for 8.0.17
- 0.0001332s
0.000201349s
=== Warmed up ===
str_contains chain: 0.010085057s
preg_match : 0.007494092s
preg_match is 25.69% faster than str_contains chain
- Output for 8.0.16
- 9.7183E-5s
0.000151245s
=== Warmed up ===
str_contains chain: 0.009090946s
preg_match : 0.0074029s
preg_match is 18.57% faster than str_contains chain
- Output for 8.0.15
- 8.0611E-5s
0.000277351s
=== Warmed up ===
str_contains chain: 0.007783966s
preg_match : 0.007983942s
preg_match is -2.57% faster than str_contains chain
- Output for 8.0.14
- 0.000127761s
0.000185679s
=== Warmed up ===
str_contains chain: 0.010069077s
preg_match : 0.007418749s
preg_match is 26.32% faster than str_contains chain
- Output for 8.0.13
- 8.9147E-5s
0.000176753s
=== Warmed up ===
str_contains chain: 0.008148584s
preg_match : 0.008590705s
preg_match is -5.43% faster than str_contains chain
- Output for 8.0.12
- 0.000127078s
0.000213792s
=== Warmed up ===
str_contains chain: 0.009745086s
preg_match : 0.008750706s
preg_match is 10.20% faster than str_contains chain
- Output for 8.0.11
- 0.0001272s
0.000184467s
=== Warmed up ===
str_contains chain: 0.009881223s
preg_match : 0.009232722s
preg_match is 6.56% faster than str_contains chain
- Output for 8.0.10
- 0.000128081s
0.000205657s
=== Warmed up ===
str_contains chain: 0.009408554s
preg_match : 0.008617696s
preg_match is 8.41% faster than str_contains chain
- Output for 8.0.9
- 0.000107341s
0.000291028s
=== Warmed up ===
str_contains chain: 0.009378497s
preg_match : 0.008434019s
preg_match is 10.07% faster than str_contains chain
- Output for 8.0.8
- 0.00010649s
0.000178226s
=== Warmed up ===
str_contains chain: 0.009492211s
preg_match : 0.007283907s
preg_match is 23.26% faster than str_contains chain
- Output for 8.0.7
- 9.8846E-5s
0.000180529s
=== Warmed up ===
str_contains chain: 0.011953251s
preg_match : 0.007982379s
preg_match is 33.22% faster than str_contains chain
- Output for 8.0.6
- 0.000109015s
0.00016447s
=== Warmed up ===
str_contains chain: 0.008477992s
preg_match : 0.008489365s
preg_match is -0.13% faster than str_contains chain
- Output for 8.0.5
- 9.1422E-5s
0.000156485s
=== Warmed up ===
str_contains chain: 0.00837629s
preg_match : 0.00875329s
preg_match is -4.50% faster than str_contains chain
- Output for 8.0.3
- 9.8295E-5s
0.000162245s
=== Warmed up ===
str_contains chain: 0.009027436s
preg_match : 0.008358588s
preg_match is 7.41% faster than str_contains chain
- Output for 8.0.2
- 9.9207E-5s
0.000183495s
=== Warmed up ===
str_contains chain: 0.009047284s
preg_match : 0.007865028s
preg_match is 13.07% faster than str_contains chain
- Output for 8.0.1
- 0.000118943s
0.001480857s
=== Warmed up ===
str_contains chain: 0.010025485s
preg_match : 0.007390797s
preg_match is 26.28% faster than str_contains chain
preferences:
88.69 ms | 567 KiB | 5 Q