3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $test = array('potato', 'salad', 'salad_rel'); $start_time = microtime(TRUE); for ($i = 0; $i < 10000; $i++){ foreach ($test as $string){ substr($string, -4) == '_rel'; } } $end_time = microtime(TRUE); echo $end_time - $start_time; $start_time = microtime(TRUE); for ($i = 0; $i < 10000; $i++){ foreach ($test as $string){ preg_match('#.{1,}_rel$#', $string); } } $end_time = microtime(TRUE); echo $end_time - $start_time;
based on Af9Oe
Output for 7.1.0
0.00309014320373540.0053839683532715
Output for 7.0.14
0.00373792648315430.0051209926605225
Output for 7.0.11
0.00171709060668950.0028870105743408
Output for 7.0.10
0.00180101394653320.0032379627227783
Output for 7.0.9
0.00180006027221680.0029280185699463
Output for 7.0.8
0.00190281867980960.0029919147491455
Output for 7.0.7
0.00245189666748050.0031249523162842
Output for 7.0.6
0.00302815437316890.0033249855041504
Output for 7.0.5
0.00245189666748050.0042328834533691
Output for 7.0.4
0.00205111503601070.0032780170440674
Output for 7.0.3
0.00276684761047360.0048930644989014
Output for 7.0.2
0.00255107879638670.0043120384216309
Output for 7.0.1
0.00215101242065430.0034360885620117
Output for 7.0.0
0.00189709663391110.0033469200134277
Output for hhvm-3.13.2
0.00577902793884280.0095129013061523
Output for hhvm-3.12.0
0.00562500953674320.0091888904571533
Output for hhvm-3.10.0
0.00819587707519530.011919975280762
Output for 5.6.28
0.00980305671691890.020550966262817
Output for 5.6.26
0.00531101226806640.012008905410767
Output for 5.6.25
0.00517606735229490.01195502281189
Output for 5.6.24
0.00472593307495120.010688066482544
Output for 5.6.23
0.00563097000122070.016542911529541
Output for 5.6.22
0.00709509849548340.01200008392334
Output for 5.6.21
0.0116410255432130.021121025085449
Output for 5.6.20
0.00783491134643550.017488956451416
Output for 5.6.19
0.00829815864562990.015573978424072
Output for 5.6.18
0.00799202919006350.015944004058838
Output for 5.6.17
0.00760507583618160.01460599899292
Output for 5.6.16
0.00525903701782230.012058973312378
Output for 5.6.15
0.00691008567810060.015630006790161
Output for 5.6.14
0.00514984130859380.012096881866455
Output for 5.6.13
0.00707983970642090.019237995147705
Output for 5.6.12
0.00869488716125490.020424127578735
Output for 5.6.11
0.006613016128540.014391899108887
Output for 5.6.10
0.00809907913208010.016496181488037
Output for 5.6.9
0.0121030807495120.026883125305176
Output for 5.6.8
0.00880408287048340.018541097640991
Output for 5.6.7
0.00839400291442870.014336824417114
Output for 5.6.6
0.00524306297302250.012486934661865
Output for 5.6.5
0.00722813606262210.016125202178955
Output for 5.6.4
0.00805497169494630.017621040344238
Output for 5.6.3
0.00847983360290530.016996145248413
Output for 5.6.2
0.0079510211944580.015283107757568
Output for 5.6.1
0.00566315650939940.013270854949951
Output for 5.6.0
0.00729489326477050.015302181243896
Output for 5.5.38
0.00542998313903810.01226282119751
Output for 5.5.37
0.00619792938232420.013627052307129
Output for 5.5.36
0.00871491432189940.01297402381897
Output for 5.5.35
0.00473093986511230.010682821273804
Output for 5.5.34
0.00535392761230470.011794805526733
Output for 5.5.33
0.00858592987060550.01830792427063
Output for 5.5.32
0.00710105895996090.012421131134033
Output for 5.5.31
0.00772500038146970.016603946685791
Output for 5.5.30
0.00712299346923830.015419960021973
Output for 5.5.29
0.00809407234191890.01715612411499
Output for 5.5.28
0.00862598419189450.017909049987793
Output for 5.5.27
0.00793290138244630.016391038894653
Output for 5.5.26
0.00945401191711430.019165992736816
Output for 5.5.25
0.0075120925903320.016355991363525
Output for 5.5.24
0.00667595863342290.014387130737305
Output for 5.5.23
0.0078101158142090.016613006591797
Output for 5.5.22
0.00722885131835940.014359951019287
Output for 5.5.21
0.00571417808532710.012872934341431
Output for 5.5.20
0.00934600830078120.019605875015259
Output for 5.5.19
0.00786495208740230.016747951507568
Output for 5.5.18
0.00856208801269530.016667127609253
Output for 5.5.16
0.00607109069824220.013643980026245
Output for 5.5.15
0.00491213798522950.010722875595093
Output for 5.5.14
0.0049250125885010.010912895202637
Output for 5.5.13
0.00570583343505860.012403011322021
Output for 5.5.12
0.00862312316894530.020541191101074
Output for 5.5.11
0.00915312767028810.018144845962524
Output for 5.5.10
0.00645494461059570.015033006668091
Output for 5.5.9
0.0110070705413820.025000095367432
Output for 5.5.8
0.00464081764221190.01817798614502
Output for 5.5.7
0.00648498535156250.014694929122925
Output for 5.5.6
0.00514316558837890.011300086975098
Output for 5.5.5
0.005594015121460.012420892715454
Output for 5.5.4
0.00884914398193360.015758037567139
Output for 5.5.3
0.00884008407592770.015594959259033
Output for 5.5.2
0.00735306739807130.014592170715332
Output for 5.5.1
0.00906705856323240.019447088241577
Output for 5.5.0
0.00731801986694340.016922950744629
Output for 5.4.45
0.0045728683471680.010512113571167
Output for 5.4.44
0.0119531154632570.015838146209717
Output for 5.4.43
0.00684380531311040.014472007751465
Output for 5.4.42
0.00787901878356930.013816118240356
Output for 5.4.41
0.00608301162719730.01333212852478
Output for 5.4.40
0.00862693786621090.015068054199219
Output for 5.4.39
0.00824999809265140.016726016998291
Output for 5.4.38
0.008260965347290.017436981201172
Output for 5.4.37
0.00876498222351070.018537044525146
Output for 5.4.36
0.0094909667968750.018247127532959
Output for 5.4.35
0.00573611259460450.012938976287842
Output for 5.4.34
0.00562310218811040.011773109436035
Output for 5.4.32
0.00586295127868650.011698007583618
Output for 5.4.31
0.00489401817321780.011284828186035
Output for 5.4.30
0.00548815727233890.012194871902466
Output for 5.4.29
0.00715303421020510.011502027511597
Output for 5.4.28
0.0052771568298340.011381149291992
Output for 5.4.27
0.00456786155700680.0099668502807617
Output for 5.4.26
0.0079979896545410.013496875762939
Output for 5.4.25
0.00929808616638180.019028902053833
Output for 5.4.24
0.00600814819335940.012706995010376
Output for 5.4.23
0.00498890876770020.010464906692505
Output for 5.4.22
0.00594496726989750.011442184448242
Output for 5.4.21
0.00839781761169430.017277002334595
Output for 5.4.20
0.00749206542968750.016928195953369
Output for 5.4.19
0.00992798805236820.017849922180176
Output for 5.4.18
0.00826692581176760.016828060150146
Output for 5.4.17
0.00766992568969730.015130996704102
Output for 5.4.16
0.00794792175292970.013066053390503
Output for 5.4.15
0.00568699836730960.011518955230713
Output for 5.4.14
0.00631499290466310.012948036193848
Output for 5.4.13
0.00749111175537110.014911890029907
Output for 5.4.12
0.00834798812866210.017734050750732
Output for 5.4.11
0.00874996185302730.018882036209106
Output for 5.4.10
0.00750803947448730.015912055969238
Output for 5.4.9
0.00870990753173830.019115924835205
Output for 5.4.8
0.00527215003967290.011565923690796
Output for 5.4.7
0.00557804107666020.012612819671631
Output for 5.4.6
0.00565004348754880.012469053268433
Output for 5.4.5
0.00784707069396970.016196012496948
Output for 5.4.4
0.00480985641479490.010726928710938
Output for 5.4.3
0.0085988044738770.017804861068726
Output for 5.4.2
0.00746297836303710.01292610168457
Output for 5.4.1
0.00702404975891110.015197992324829
Output for 5.4.0
0.0096881389617920.02052903175354
Output for 5.3.29
0.00766110420227050.016361951828003
Output for 5.3.28
0.00521802902221680.011321067810059
Output for 5.3.27
0.00853800773620610.014841079711914
Output for 5.3.26
0.00631904602050780.013968944549561
Output for 5.3.25
0.00964188575744630.021430015563965
Output for 5.3.24
0.00959610939025880.01767110824585
Output for 5.3.23
0.00775480270385740.016022920608521
Output for 5.3.22
0.0092091560363770.018190145492554
Output for 5.3.21
0.00973892211914060.01827597618103
Output for 5.3.20
0.00758504867553710.01610803604126
Output for 5.3.19
0.00914311408996580.017930030822754
Output for 5.3.18
0.00722599029541020.014015197753906
Output for 5.3.17
0.00945305824279790.018418788909912
Output for 5.3.16
0.00748300552368160.015542984008789
Output for 5.3.15
0.00840711593627930.014219999313354
Output for 5.3.14
0.00949311256408690.018607139587402
Output for 5.3.13
0.00842094421386720.017436981201172
Output for 5.3.12
0.00778388977050780.014066219329834
Output for 5.3.11
0.00993323326110840.02037501335144
Output for 5.3.10
0.010076045989990.017331123352051
Output for 5.3.9
0.0100829601287840.019836902618408
Output for 5.3.8
0.00953698158264160.019562959671021
Output for 5.3.7
0.0122768878936770.019178867340088
Output for 5.3.6
0.00975418090820310.019404172897339
Output for 5.3.5
0.00861001014709470.01783299446106
Output for 5.3.4
0.00930404663085940.018806934356689
Output for 5.3.3
0.00847387313842770.01390814781189
Output for 5.3.2
0.00880908966064450.017194986343384
Output for 5.3.1
0.00878500938415530.016742944717407
Output for 5.3.0
0.00756001472473140.013451099395752
Output for 5.2.17
0.0112900733947750.020677089691162
Output for 5.2.16
0.0114848613739010.02152419090271
Output for 5.2.15
0.0159840583801270.028794050216675
Output for 5.2.14
0.00746989250183110.015483856201172
Output for 5.2.13
0.00714993476867680.013293981552124
Output for 5.2.12
0.0114660263061520.020954847335815
Output for 5.2.11
0.0117440223693850.022540092468262
Output for 5.2.10
0.00961017608642580.017637968063354
Output for 5.2.9
0.0111818313598630.021010160446167
Output for 5.2.8
0.010468959808350.019066095352173
Output for 5.2.7
0.0107450485229490.019871950149536
Output for 5.2.6
0.0100290775299070.017749071121216
Output for 5.2.5
0.00654983520507810.012706995010376
Output for 5.2.4
0.0112299919128420.020308017730713
Output for 5.2.3
0.00945401191711430.018028020858765
Output for 5.2.2
0.007141113281250.01446795463562
Output for 5.2.1
0.0100398063659670.018726110458374
Output for 5.2.0
0.00646114349365230.012229919433594
Output for 5.1.6
0.00639104843139650.012486934661865
Output for 5.1.5
0.00881004333496090.019221067428589
Output for 5.1.4
0.00973796844482420.014907121658325
Output for 5.1.3
0.00546693801879880.010603904724121
Output for 5.1.2
0.0127348899841310.023408174514771
Output for 5.1.1
0.00670790672302250.012517929077148
Output for 5.1.0
0.0132620334625240.016995906829834
Output for 5.0.5
0.0149180889129640.020194053649902
Output for 5.0.4
0.0225610733032230.026293039321899
Output for 5.0.3
0.0196888446807860.023358106613159
Output for 5.0.2
0.0201079845428470.026005029678345
Output for 5.0.1
0.0196170806884770.023063182830811
Output for 5.0.0
0.0206720829010010.025012969970703
Output for 4.4.9
0.0193460.026798
Output for 4.4.8
0.0155580.022821
Output for 4.4.7
0.0180420.02621
Output for 4.4.6
0.0162380.023899
Output for 4.4.5
0.0174070.023361
Output for 4.4.4
0.0126280.019348
Output for 4.4.3
0.014620.020636
Output for 4.4.2
0.0174650.025495
Output for 4.4.1
0.0161540.021103
Output for 4.4.0
0.0084550.013797
Output for 4.3.11
0.0186430.022739
Output for 4.3.10
0.0090650.013763
Output for 4.3.9
0.0215810.026933
Output for 4.3.8
0.0209720.023777
Output for 4.3.7
0.0206770.021238
Output for 4.3.6
0.0216380.026506
Output for 4.3.5
0.024420.028302
Output for 4.3.4
0.0195570.022915
Output for 4.3.3
0.0222750.02733
Output for 4.3.2
0.0227240.026038
Output for 4.3.1
0.0175840.020397
Output for 4.3.0
0.024570.02566