3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $arr = array_fill(0, 1000, 'xxxxx'); $runs = 100; $first = 0.0; $second = 0.0; for ($i = 0; $i < $runs; $i++) { $start = microtime(true); foreach ($arr as &$value) { strpos('xxxxxxx', $value); } $end = microtime(true); $second += ($end-$start); $start = microtime(true); foreach ($arr as $value) { strpos('xxxxxxx', $value); } $end = microtime(true); $first += ($end-$start); } print "First: " . ($first/$runs) . PHP_EOL; print "Second: " . ($second/$runs) . PHP_EOL;
Output for 7.1.0
First: 5.915641784668E-5 Second: 6.6061019897461E-5
Output for 7.0.14
First: 5.3415298461914E-5 Second: 6.1109066009521E-5
Output for 7.0.7
First: 4.4214725494385E-5 Second: 4.995584487915E-5
Output for 7.0.6
First: 3.9074420928955E-5 Second: 4.570484161377E-5
Output for 7.0.5
First: 5.2330493927002E-5 Second: 5.9196949005127E-5
Output for 7.0.4
First: 5.0673484802246E-5 Second: 5.8021545410156E-5
Output for 7.0.3
First: 4.591703414917E-5 Second: 5.1395893096924E-5
Output for 7.0.2
First: 5.0973892211914E-5 Second: 5.7282447814941E-5
Output for 7.0.1
First: 4.7807693481445E-5 Second: 5.2933692932129E-5
Output for 7.0.0
First: 4.5673847198486E-5 Second: 4.9464702606201E-5
Output for 5.6.28
First: 0.00023214817047119 Second: 0.00022992610931396
Output for 5.6.22
First: 0.00017873048782349 Second: 0.00017428636550903
Output for 5.6.21
First: 0.00018574476242065 Second: 0.00018758296966553
Output for 5.6.20
First: 0.0001910138130188 Second: 0.00019264459609985
Output for 5.6.19
First: 0.00019165277481079 Second: 0.00019504547119141
Output for 5.6.18
First: 0.00015735387802124 Second: 0.00015795707702637
Output for 5.6.17
First: 0.00017250061035156 Second: 0.00017081499099731
Output for 5.6.16
First: 0.00018641710281372 Second: 0.00018957376480103
Output for 5.6.15
First: 0.00020057916641235 Second: 0.00020444631576538
Output for 5.6.14
First: 0.00019898891448975 Second: 0.00019604921340942
Output for 5.6.13
First: 0.00018858909606934 Second: 0.00018867015838623
Output for 5.6.12
First: 0.00019903421401978 Second: 0.00020369291305542
Output for 5.6.11
First: 0.00017986059188843 Second: 0.00018384218215942
Output for 5.6.10
First: 0.00020193338394165 Second: 0.00021242141723633
Output for 5.6.9
First: 0.00021494388580322 Second: 0.00021872520446777
Output for 5.6.8
First: 0.0001664137840271 Second: 0.00017317295074463
Output for 5.6.7
First: 0.00019286632537842 Second: 0.00020059108734131
Output for 5.6.6
First: 0.00020116806030273 Second: 0.0002046012878418
Output for 5.6.5
First: 0.00020468473434448 Second: 0.00020511388778687
Output for 5.6.4
First: 0.00013919353485107 Second: 0.00014185190200806
Output for 5.6.3
First: 0.00013636350631714 Second: 0.00014045238494873
Output for 5.6.2
First: 0.0001526927947998 Second: 0.00014236450195313
Output for 5.6.1
First: 0.00016011714935303 Second: 0.00014339685440063
Output for 5.6.0
First: 0.00014108896255493 Second: 0.00014485120773315
Output for 5.5.36
First: 0.00018378734588623 Second: 0.00018206596374512
Output for 5.5.35
First: 0.00021114826202393 Second: 0.00021389245986938
Output for 5.5.34
First: 0.00019135475158691 Second: 0.00019298553466797
Output for 5.5.33
First: 0.00016901731491089 Second: 0.00017443180084229
Output for 5.5.32
First: 0.0001859712600708 Second: 0.00018670320510864
Output for 5.5.31
First: 0.00019386768341064 Second: 0.00019808292388916
Output for 5.5.30
First: 0.00016801834106445 Second: 0.00017132759094238
Output for 5.5.29
First: 0.00021037340164185 Second: 0.00021624803543091
Output for 5.5.28
First: 0.00018178701400757 Second: 0.00017991065979004
Output for 5.5.27
First: 0.00021162509918213 Second: 0.00021394014358521
Output for 5.5.26
First: 0.00021538972854614 Second: 0.00021718263626099
Output for 5.5.25
First: 0.00021536827087402 Second: 0.00021624565124512
Output for 5.5.24
First: 0.00022129774093628 Second: 0.00022220134735107
Output for 5.5.23
First: 0.00020771265029907 Second: 0.00021011829376221
Output for 5.5.22
First: 0.00021610736846924 Second: 0.00021856069564819
Output for 5.5.21
First: 0.00020501375198364 Second: 0.00020636558532715
Output for 5.5.20
First: 0.00018638610839844 Second: 0.00018980264663696
Output for 5.5.19
First: 0.00014840126037598 Second: 0.00014838695526123
Output for 5.5.18
First: 0.0001462459564209 Second: 0.00014735698699951
Output for 5.5.16
First: 0.00014792203903198 Second: 0.00014817237854004
Output for 5.5.15
First: 0.00012604713439941 Second: 0.00012678623199463
Output for 5.5.14
First: 0.00024169206619263 Second: 0.0002367901802063
Output for 5.5.13
First: 0.0001572585105896 Second: 0.00015665054321289
Output for 5.5.12
First: 0.00023685693740845 Second: 0.00023432016372681
Output for 5.5.11
First: 0.00012016773223877 Second: 0.0001224422454834
Output for 5.5.10
First: 0.00024224996566772 Second: 0.00024013996124268
Output for 5.5.9
First: 0.00012576818466187 Second: 0.00012497186660767
Output for 5.5.8
First: 0.00011896133422852 Second: 0.00012090921401978
Output for 5.5.7
First: 0.00012528896331787 Second: 0.00012409448623657
Output for 5.5.6
First: 0.0001225209236145 Second: 0.00012457609176636
Output for 5.5.5
First: 0.00016456127166748 Second: 0.00016675710678101
Output for 5.5.4
First: 0.00012221336364746 Second: 0.00012403249740601
Output for 5.5.3
First: 0.00013386487960815 Second: 0.00013410329818726
Output for 5.5.2
First: 0.0002323055267334 Second: 0.0002343225479126
Output for 5.5.1
First: 0.00018836736679077 Second: 0.00018978118896484
Output for 5.5.0
First: 0.00015490531921387 Second: 0.00015445709228516
Output for 5.4.45
First: 0.00018489837646484 Second: 0.00018914461135864
Output for 5.4.44
First: 0.00020279407501221 Second: 0.00020693778991699
Output for 5.4.43
First: 0.00021518230438232 Second: 0.00022237539291382
Output for 5.4.42
First: 0.00019898891448975 Second: 0.00021044015884399
Output for 5.4.41
First: 0.00021799325942993 Second: 0.00022579193115234
Output for 5.4.40
First: 0.00022397756576538 Second: 0.00022877931594849
Output for 5.4.39
First: 0.00021572589874268 Second: 0.00021989583969116
Output for 5.4.38
First: 0.00021607398986816 Second: 0.00022341966629028
Output for 5.4.37
First: 0.00017732858657837 Second: 0.00018059253692627
Output for 5.4.36
First: 0.00020098209381104 Second: 0.00020520448684692
Output for 5.4.35
First: 0.00014230966567993 Second: 0.0001448917388916
Output for 5.4.34
First: 0.00014965295791626 Second: 0.00015337228775024
Output for 5.4.32
First: 0.00014499664306641 Second: 0.00015106916427612
Output for 5.4.31
First: 0.00011853694915771 Second: 0.00012076377868652
Output for 5.4.30
First: 0.00023705244064331 Second: 0.00023545265197754
Output for 5.4.29
First: 0.00028763771057129 Second: 0.00028776884078979
Output for 5.4.28
First: 0.00016873359680176 Second: 0.00016472339630127
Output for 5.4.27
First: 0.00012239217758179 Second: 0.00011781454086304
Output for 5.4.26
First: 0.00011732816696167 Second: 0.0001164984703064
Output for 5.4.25
First: 0.00012127161026001 Second: 0.00011796712875366
Output for 5.4.24
First: 0.00012693881988525 Second: 0.00012286901473999
Output for 5.4.23
First: 0.00012564659118652 Second: 0.00011730432510376
Output for 5.4.22
First: 0.00012640953063965 Second: 0.00012219667434692
Output for 5.4.21
First: 0.00012474060058594 Second: 0.00012006044387817
Output for 5.4.20
First: 0.00012284517288208 Second: 0.00011630296707153
Output for 5.4.19
First: 0.00011656284332275 Second: 0.00011592626571655
Output for 5.4.18
First: 0.00016119956970215 Second: 0.00015964984893799
Output for 5.4.17
First: 0.00017314910888672 Second: 0.00017591238021851
Output for 5.4.16
First: 0.00022399663925171 Second: 0.00022562265396118
Output for 5.4.15
First: 0.0002167797088623 Second: 0.00021556377410889
Output for 5.4.14
First: 0.00021739959716797 Second: 0.00021982908248901
Output for 5.4.13
First: 0.00016828298568726 Second: 0.00016723155975342
Output for 5.4.12
First: 0.00020424127578735 Second: 0.00020377397537231
Output for 5.4.11
First: 0.00019583940505981 Second: 0.00019744634628296
Output for 5.4.10
First: 0.00022112131118774 Second: 0.00022428512573242
Output for 5.4.9
First: 0.00021648645401001 Second: 0.00021703004837036
Output for 5.4.8
First: 0.00023527860641479 Second: 0.00023412227630615
Output for 5.4.7
First: 0.00021755695343018 Second: 0.00021953344345093
Output for 5.4.6
First: 0.00022285461425781 Second: 0.00022894382476807
Output for 5.4.5
First: 0.00014329671859741 Second: 0.00014435052871704
Output for 5.4.4
First: 0.00018857002258301 Second: 0.00019192218780518
Output for 5.4.3
First: 0.00022472381591797 Second: 0.00022640943527222
Output for 5.4.2
First: 0.00021713972091675 Second: 0.00022119760513306
Output for 5.4.1
First: 0.0002303671836853 Second: 0.0002284574508667
Output for 5.4.0
First: 0.00022350549697876 Second: 0.00023583173751831
Output for 5.3.29
First: 0.00018452882766724 Second: 0.000177161693573
Output for 5.3.28
First: 0.00016093492507935 Second: 0.00015246391296387
Output for 5.3.27
First: 0.00027363300323486 Second: 0.00026524066925049
Output for 5.3.26
First: 0.00026049613952637 Second: 0.00025156259536743
Output for 5.3.25
First: 0.0002682638168335 Second: 0.00026454210281372
Output for 5.3.24
First: 0.00023241758346558 Second: 0.00022040843963623
Output for 5.3.23
First: 0.00023467540740967 Second: 0.00022913932800293
Output for 5.3.22
First: 0.00020397901535034 Second: 0.00019827365875244
Output for 5.3.21
First: 0.00025113582611084 Second: 0.00023691892623901
Output for 5.3.20
First: 0.00028075218200684 Second: 0.00027003049850464
Output for 5.3.19
First: 0.00025830507278442 Second: 0.0002462363243103
Output for 5.3.18
First: 0.00025407791137695 Second: 0.00024128675460815
Output for 5.3.17
First: 0.00022282838821411 Second: 0.00021280288696289
Output for 5.3.16
First: 0.0002789568901062 Second: 0.00026901721954346
Output for 5.3.15
First: 0.0001957368850708 Second: 0.0001860523223877
Output for 5.3.14
First: 0.00023839712142944 Second: 0.00022347688674927
Output for 5.3.13
First: 0.00025406122207642 Second: 0.00024333477020264
Output for 5.3.12
First: 0.000281081199646 Second: 0.00026802062988281
Output for 5.3.11
First: 0.00028513193130493 Second: 0.00027181625366211
Output for 5.3.10
First: 0.00029452085494995 Second: 0.00027774572372437
Output for 5.3.9
First: 0.00030054807662964 Second: 0.000286545753479
Output for 5.3.8
First: 0.00028059482574463 Second: 0.0002627420425415
Output for 5.3.7
First: 0.00028689384460449 Second: 0.00026950597763062
Output for 5.3.6
First: 0.00029047727584839 Second: 0.00027614831924438
Output for 5.3.5
First: 0.00029051065444946 Second: 0.00027734756469727
Output for 5.3.4
First: 0.00024378776550293 Second: 0.00023115634918213
Output for 5.3.3
First: 0.00028496742248535 Second: 0.0002769923210144
Output for 5.3.2
First: 0.00027229309082031 Second: 0.00025917053222656
Output for 5.3.1
First: 0.00022438287734985 Second: 0.00021528482437134
Output for 5.3.0
First: 0.00025663614273071 Second: 0.00024246215820313
Output for 5.2.17
First: 0.00027919054031372 Second: 0.0002416467666626
Output for 5.2.16
First: 0.00024599552154541 Second: 0.00021115064620972
Output for 5.2.15
First: 0.00028258085250854 Second: 0.00024426460266113
Output for 5.2.14
First: 0.00032324075698853 Second: 0.00028064250946045
Output for 5.2.13
First: 0.0003033971786499 Second: 0.00026353359222412
Output for 5.2.12
First: 0.00027818918228149 Second: 0.00024236679077148
Output for 5.2.11
First: 0.00028090238571167 Second: 0.0002558422088623
Output for 5.2.10
First: 0.00027810335159302 Second: 0.00024721384048462
Output for 5.2.9
First: 0.00030208587646484 Second: 0.00027740240097046
Output for 5.2.8
First: 0.0002777099609375 Second: 0.00025621891021729
Output for 5.2.7
First: 0.00028403520584106 Second: 0.00026443243026733
Output for 5.2.6
First: 0.00028170585632324 Second: 0.00025418043136597
Output for 5.2.5
First: 0.00029046058654785 Second: 0.00026639699935913
Output for 5.2.4
First: 0.00028898239135742 Second: 0.00023924112319946
Output for 5.2.3
First: 0.00029844522476196 Second: 0.00027428865432739
Output for 5.2.2
First: 0.00019128799438477 Second: 0.00017272472381592
Output for 5.2.1
First: 0.0002739429473877 Second: 0.00024041414260864
Output for 5.2.0
First: 0.00027808904647827 Second: 0.00025433540344238
Output for 5.1.6
First: 0.00025145292282104 Second: 0.00021319627761841
Output for 5.1.5
First: 0.00030077695846558 Second: 0.00025271654129028
Output for 5.1.4
First: 0.00029381990432739 Second: 0.0002566123008728
Output for 5.1.3
First: 0.00032114505767822 Second: 0.00027901649475098
Output for 5.1.2
First: 0.00025559425354004 Second: 0.00021518707275391
Output for 5.1.1
First: 0.00023927688598633 Second: 0.00020732879638672
Output for 5.1.0
First: 0.0001844310760498 Second: 0.00015868425369263
Output for 5.0.5
First: 0.00039331197738647 Second: 0.00036571502685547
Output for 5.0.4
First: 0.00056637763977051 Second: 0.0005347752571106
Output for 5.0.3
First: 0.00036135673522949 Second: 0.00033664464950562
Output for 5.0.2
First: 0.00036972999572754 Second: 0.00034686088562012
Output for 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3XPLO on line 27 First: 0.00047149419784546PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3XPLO on line 28 Second: 0.00043696641921997PHP_EOL
Output for 5.0.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3XPLO on line 27 First: 0.00049413919448853PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/3XPLO on line 28 Second: 0.00046027421951294PHP_EOL
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /in/3XPLO on line 12
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /in/3XPLO on line 12
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /in/3XPLO on line 12
Process exited with code 255.