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 < 100000; $i++){ foreach ($test as $string){ substr($string, -4) == '_rel'; } } $end_time = microtime(TRUE); echo $end_time - $start_time . PHP_EOL; $start_time = microtime(TRUE); for ($i = 0; $i < 100000; $i++){ foreach ($test as $string){ preg_match('#.{1,}_rel$#', $string); } } $end_time = microtime(TRUE); echo $end_time - $start_time . PHP_EOL;
based on jhVjq
Output for 7.1.0
0.029834032058716 0.045920133590698
Output for 7.0.14
0.03595495223999 0.0046288967132568
Output for 7.0.11
0.018199920654297 0.02951192855835
Output for 7.0.10
0.028927087783813 0.040753126144409
Output for 7.0.9
0.016447067260742 0.027124881744385
Output for 7.0.8
0.022855997085571 0.030767917633057
Output for 7.0.7
0.015722036361694 0.026401042938232
Output for 7.0.6
0.019845008850098 0.030271053314209
Output for 7.0.5
0.022636890411377 0.031929016113281
Output for 7.0.4
0.019090890884399 0.029906034469604
Output for 7.0.3
0.018555879592896 0.030364990234375
Output for 7.0.2
0.018703937530518 0.033467054367065
Output for 7.0.1
0.018590211868286 0.029762983322144
Output for 7.0.0
0.024245977401733 0.046135902404785
Output for hhvm-3.13.2
0.053334951400757 0.081110000610352
Output for hhvm-3.12.0
0.056617021560669 0.086771965026855
Output for hhvm-3.10.0
0.07572603225708 0.11134004592896
Output for 5.6.28
0.085865020751953 0.1421000957489
Output for 5.6.26
0.058764934539795 0.12010312080383
Output for 5.6.25
0.051604986190796 0.1192090511322
Output for 5.6.24
0.064537048339844 0.12022590637207
Output for 5.6.23
0.056307077407837 0.12039589881897
Output for 5.6.22
0.046616077423096 0.1118848323822
Output for 5.6.21
0.048563957214355 0.10968995094299
Output for 5.6.20
0.056825160980225 0.12059307098389
Output for 5.6.19
0.06908917427063 0.12497210502625
Output for 5.6.18
0.054571151733398 0.1206111907959
Output for 5.6.17
0.077941179275513 0.1203920841217
Output for 5.6.16
0.053322076797485 0.1369481086731
Output for 5.6.15
0.075530052185059 0.13038897514343
Output for 5.6.14
0.054744958877563 0.11142611503601
Output for 5.6.13
0.07175612449646 0.12180685997009
Output for 5.6.12
0.065931081771851 0.12056398391724
Output for 5.6.11
0.069243907928467 0.15725708007812
Output for 5.6.10
0.053118944168091 0.11967897415161
Output for 5.6.9
0.075491905212402 0.12194991111755
Output for 5.6.8
0.059653997421265 0.11981010437012
Output for 5.6.7
0.054344177246094 0.11980104446411
Output for 5.6.6
0.050861835479736 0.12018799781799
Output for 5.6.5
0.052964925765991 0.12374901771545
Output for 5.6.4
0.08070707321167 0.12169814109802
Output for 5.6.3
0.051898956298828 0.11843299865723
Output for 5.6.2
0.064496040344238 0.11914205551147
Output for 5.6.1
0.063395023345947 0.13549613952637
Output for 5.6.0
0.049391984939575 0.10952997207642
Output for 5.5.38
0.055696964263916 0.12411999702454
Output for 5.5.37
0.049138069152832 0.11343288421631
Output for 5.5.36
0.054110050201416 0.12070894241333
Output for 5.5.35
0.059576988220215 0.12013006210327
Output for 5.5.34
0.071815967559814 0.1281361579895
Output for 5.5.33
0.070255041122437 0.12115502357483
Output for 5.5.32
0.053023099899292 0.11954498291016
Output for 5.5.31
0.053812980651855 0.11986708641052
Output for 5.5.30
0.049520015716553 0.11091494560242
Output for 5.5.29
0.064656972885132 0.13154697418213
Output for 5.5.28
0.05354380607605 0.1200840473175
Output for 5.5.27
0.077399969100952 0.12899804115295
Output for 5.5.26
0.075268030166626 0.11959409713745
Output for 5.5.25
0.120845079422 0.12112498283386
Output for 5.5.24
0.071910858154297 0.12523484230042
Output for 5.5.23
0.060302019119263 0.11458683013916
Output for 5.5.22
0.059777021408081 0.13118815422058
Output for 5.5.21
0.05479907989502 0.12122797966003
Output for 5.5.20
0.064815998077393 0.12169790267944
Output for 5.5.19
0.055905103683472 0.11906909942627
Output for 5.5.18
0.059530973434448 0.12015604972839
Output for 5.5.16
0.048668146133423 0.10963606834412
Output for 5.5.15
0.063207864761353 0.13598489761353
Output for 5.5.14
0.060647964477539 0.12016415596008
Output for 5.5.13
0.050167798995972 0.11345386505127
Output for 5.5.12
0.06048583984375 0.13222813606262
Output for 5.5.11
0.047990083694458 0.10783505439758
Output for 5.5.10
0.065029859542847 0.10387206077576
Output for 5.5.9
0.054496049880981 0.12042284011841
Output for 5.5.8
0.053663969039917 0.11913681030273
Output for 5.5.7
0.050545930862427 0.098745107650757
Output for 5.5.6
0.053738832473755 0.10082101821899
Output for 5.5.5
0.044504880905151 0.099256992340088
Output for 5.5.4
0.05710506439209 0.11352205276489
Output for 5.5.3
0.053964138031006 0.10801696777344
Output for 5.5.2
0.045240163803101 0.098655939102173
Output for 5.5.1
0.045366048812866 0.098742008209229
Output for 5.5.0
0.049968957901001 0.11490917205811
Output for 5.4.45
0.046208143234253 0.10413193702698
Output for 5.4.44
0.057123899459839 0.1139121055603
Output for 5.4.43
0.065812110900879 0.11895608901978
Output for 5.4.42
0.05765700340271 0.11493396759033
Output for 5.4.41
0.047239065170288 0.10244083404541
Output for 5.4.40
0.058578968048096 0.12653088569641
Output for 5.4.39
0.07348895072937 0.11483287811279
Output for 5.4.38
0.066174983978271 0.11771607398987
Output for 5.4.37
0.065869092941284 0.11689209938049
Output for 5.4.36
0.053631782531738 0.11660099029541
Output for 5.4.35
0.058972120285034 0.12594318389893
Output for 5.4.34
0.070846080780029 0.1193470954895
Output for 5.4.32
0.047619819641113 0.10521101951599
Output for 5.4.31
0.046986103057861 0.10433602333069
Output for 5.4.30
0.05112099647522 0.096528053283691
Output for 5.4.29
0.080065011978149 0.14077997207642
Output for 5.4.28
0.051172971725464 0.10245800018311
Output for 5.4.27
0.081609010696411 0.11974191665649
Output for 5.4.26
0.064832210540771 0.1074960231781
Output for 5.4.25
0.078030109405518 0.11409091949463
Output for 5.4.24
0.0523841381073 0.10335397720337
Output for 5.4.23
0.045372009277344 0.10450005531311
Output for 5.4.22
0.065141916275024 0.12556600570679
Output for 5.4.21
0.044929027557373 0.12606501579285
Output for 5.4.20
0.058712005615234 0.11898183822632
Output for 5.4.19
0.043268918991089 0.093542814254761
Output for 5.4.18
0.043515920639038 0.095595836639404
Output for 5.4.17
0.051719903945923 0.11039996147156
Output for 5.4.16
0.054991006851196 0.10746312141418
Output for 5.4.15
0.043387889862061 0.095224142074585
Output for 5.4.14
0.060286998748779 0.095319986343384
Output for 5.4.13
0.043350219726562 0.096272945404053
Output for 5.4.12
0.066184043884277 0.1153519153595
Output for 5.4.11
0.059230804443359 0.11601996421814
Output for 5.4.10
0.078773975372314 0.12778782844543
Output for 5.4.9
0.052126884460449 0.11700892448425
Output for 5.4.8
0.058178901672363 0.14333295822144
Output for 5.4.7
0.05233907699585 0.11513495445251
Output for 5.4.6
0.06309700012207 0.13430190086365
Output for 5.4.5
0.063685894012451 0.12886595726013
Output for 5.4.4
0.072723150253296 0.12314295768738
Output for 5.4.3
0.067928791046143 0.12264895439148
Output for 5.4.2
0.056029796600342 0.12773489952087
Output for 5.4.1
0.055222034454346 0.12963199615479
Output for 5.4.0
0.053508996963501 0.12268900871277
Output for 5.3.29
0.062650918960571 0.12311601638794
Output for 5.3.28
0.057669878005981 0.11867022514343
Output for 5.3.27
0.058718919754028 0.10221385955811
Output for 5.3.26
0.047518968582153 0.10204100608826
Output for 5.3.25
0.055562973022461 0.10388994216919
Output for 5.3.24
0.075623989105225 0.10190105438232
Output for 5.3.23
0.068330049514771 0.14625716209412
Output for 5.3.22
0.066570043563843 0.13435792922974
Output for 5.3.21
0.069632053375244 0.13255500793457
Output for 5.3.20
0.05846905708313 0.12388300895691
Output for 5.3.19
0.082165956497192 0.13360118865967
Output for 5.3.18
0.06122899055481 0.13027787208557
Output for 5.3.17
0.083333969116211 0.13344812393188
Output for 5.3.16
0.10149192810059 0.12984704971313
Output for 5.3.15
0.067554950714111 0.12557315826416
Output for 5.3.14
0.059620141983032 0.12502121925354
Output for 5.3.13
0.058324098587036 0.12381792068481
Output for 5.3.12
0.066848039627075 0.15908408164978
Output for 5.3.11
0.070235013961792 0.12478995323181
Output for 5.3.10
0.075536012649536 0.1228940486908
Output for 5.3.9
0.061092138290405 0.16312479972839
Output for 5.3.8
0.060030937194824 0.12391686439514
Output for 5.3.7
0.062352180480957 0.1272280216217
Output for 5.3.6
0.064884901046753 0.12684392929077
Output for 5.3.5
0.070218086242676 0.15131592750549
Output for 5.3.4
0.083705186843872 0.13073420524597
Output for 5.3.3
0.10385608673096 0.1228039264679
Output for 5.3.2
0.066900014877319 0.12713098526001
Output for 5.3.1
0.060862064361572 0.12145781517029
Output for 5.3.0
0.062723159790039 0.12203884124756
Output for 5.2.17
0.076304197311401 0.12755799293518
Output for 5.2.16
0.095213890075684 0.13695311546326
Output for 5.2.15
0.066858053207397 0.12684798240662
Output for 5.2.14
0.07271409034729 0.15001893043518
Output for 5.2.13
0.060256004333496 0.11741590499878
Output for 5.2.12
0.070791006088257 0.12651109695435
Output for 5.2.11
0.072759866714478 0.12755298614502
Output for 5.2.10
0.073096990585327 0.15744805335999
Output for 5.2.9
0.065359115600586 0.12700009346008
Output for 5.2.8
0.082324981689453 0.13684415817261
Output for 5.2.7
0.058671951293945 0.12199401855469
Output for 5.2.6
0.079322814941406 0.15351915359497
Output for 5.2.5
0.066573143005371 0.12889695167542
Output for 5.2.4
0.071100950241089 0.124272108078
Output for 5.2.3
0.064843893051147 0.1361129283905
Output for 5.2.2
0.064922094345093 0.11983609199524
Output for 5.2.1
0.059340000152588 0.11872696876526
Output for 5.2.0
0.075768947601318 0.14608097076416
Output for 5.1.6
0.060343027114868 0.13073015213013
Output for 5.1.5
0.083739042282104 0.15755009651184
Output for 5.1.4
0.051996946334839 0.10840582847595
Output for 5.1.3
0.051570892333984 0.099762916564941
Output for 5.1.2
0.10349488258362 0.1271390914917
Output for 5.1.1
0.092820882797241 0.13001298904419
Output for 5.1.0
0.074343919754028 0.14719104766846
Output for 5.0.5
0.12875294685364 0.16620588302612
Output for 5.0.4
0.10943007469177 0.14539217948914
Output for 5.0.3
0.10092902183533 0.1410801410675
Output for 5.0.2
0.1273090839386 0.19197511672974
Output for 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 12 0.099440097808838PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 22 0.14113116264343PHP_EOL
Output for 5.0.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 12 0.11989283561707PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 22 0.13966417312622PHP_EOL
Output for 4.4.9
0.096858 0.148136
Output for 4.4.8
0.101493 0.129344
Output for 4.4.7
0.092443 0.137858
Output for 4.4.6
0.094959 0.150053
Output for 4.4.5
0.110156 0.169148
Output for 4.4.4
0.082008 0.121945
Output for 4.4.3
0.104988 0.159237
Output for 4.4.2
0.09654 0.152794
Output for 4.4.1
0.080626 0.121538
Output for 4.4.0
0.120777 0.151463
Output for 4.3.11
0.089136 0.133671
Output for 4.3.10
0.10362 0.139547
Output for 4.3.9
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 12 0.100263PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 22 0.158725PHP_EOL
Output for 4.3.8
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 12 0.106929PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 22 0.156815PHP_EOL
Output for 4.3.7
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 12 0.139807PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 22 0.188173PHP_EOL
Output for 4.3.6
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 12 0.101196PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 22 0.146889PHP_EOL
Output for 4.3.5
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 12 0.120274PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 22 0.15256PHP_EOL
Output for 4.3.4
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 12 0.10159PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 22 0.133268PHP_EOL
Output for 4.3.3
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 12 0.108842PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 22 0.137158PHP_EOL
Output for 4.3.2
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 12 0.123679PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 22 0.123414PHP_EOL
Output for 4.3.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 12 0.120703PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 22 0.147714PHP_EOL
Output for 4.3.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 12 0.106459PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/VYeJS on line 22 0.123891PHP_EOL