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); $first += ($end-$start); $start = microtime(true); foreach ($arr as &$value) { strpos('xxxxxxx', $value); } $end = microtime(true); $second += ($end-$start); } print "First: " . ($first/$runs) . PHP_EOL; print "Second: " . ($second/$runs) . PHP_EOL;
Output for 7.1.0
First: 3.1259059906006E-5 Second: 3.4935474395752E-5
Output for 7.0.14
First: 5.4831504821777E-5 Second: 6.2398910522461E-5
Output for 7.0.7
First: 4.0528774261475E-5 Second: 4.7438144683838E-5
Output for 7.0.6
First: 4.4288635253906E-5 Second: 4.9657821655273E-5
Output for 7.0.5
First: 4.906177520752E-5 Second: 5.5844783782959E-5
Output for 7.0.4
First: 4.3022632598877E-5 Second: 4.8646926879883E-5
Output for 7.0.3
First: 5.0840377807617E-5 Second: 5.7401657104492E-5
Output for 7.0.2
First: 5.9225559234619E-5 Second: 6.6766738891602E-5
Output for 7.0.1
First: 5.8102607727051E-5 Second: 6.3378810882568E-5
Output for 7.0.0
First: 5.3763389587402E-5 Second: 5.8987140655518E-5
Output for hhvm-3.12.0
First: 0.00011754274368286 Second: 0.00012673139572144
Output for hhvm-3.10.0
First: 0.00012098073959351 Second: 0.00011849403381348
Output for 5.6.28
First: 0.00023780345916748 Second: 0.00023425340652466
Output for 5.6.22
First: 0.00019968271255493 Second: 0.00019544839859009
Output for 5.6.21
First: 0.00022516965866089 Second: 0.00022737741470337
Output for 5.6.20
First: 0.00024112939834595 Second: 0.00023834466934204
Output for 5.6.19
First: 0.00022615194320679 Second: 0.00022894620895386
Output for 5.6.18
First: 0.0002045202255249 Second: 0.00020732402801514
Output for 5.6.17
First: 0.00014461755752563 Second: 0.00014413356781006
Output for 5.6.16
First: 0.00020745038986206 Second: 0.00020889759063721
Output for 5.6.15
First: 0.00018558263778687 Second: 0.0001856255531311
Output for 5.6.14
First: 0.00022125482559204 Second: 0.000219407081604
Output for 5.6.13
First: 0.0001957368850708 Second: 0.00019454956054688
Output for 5.6.12
First: 0.00022261619567871 Second: 0.00022659778594971
Output for 5.6.11
First: 0.00021054267883301 Second: 0.00021758794784546
Output for 5.6.10
First: 0.00021821022033691 Second: 0.00022634744644165
Output for 5.6.9
First: 0.0002259635925293 Second: 0.0002328085899353
Output for 5.6.8
First: 0.00015069484710693 Second: 0.00015570163726807
Output for 5.6.7
First: 0.00022292613983154 Second: 0.00023330688476562
Output for 5.6.6
First: 0.00017805576324463 Second: 0.00018171310424805
Output for 5.6.5
First: 0.00014979839324951 Second: 0.00015092372894287
Output for 5.6.4
First: 0.00023267030715942 Second: 0.000232994556427
Output for 5.6.3
First: 0.00021937370300293 Second: 0.00022269725799561
Output for 5.6.2
First: 0.00022377014160156 Second: 0.00020783662796021
Output for 5.6.1
First: 0.00026432752609253 Second: 0.00024422645568848
Output for 5.6.0
First: 0.00015609741210938 Second: 0.00015677690505981
Output for 5.5.36
First: 0.0002143406867981 Second: 0.000208740234375
Output for 5.5.35
First: 0.00020889759063721 Second: 0.00021151304244995
Output for 5.5.34
First: 0.00024598598480225 Second: 0.00024655103683472
Output for 5.5.33
First: 0.0002016282081604 Second: 0.00020415067672729
Output for 5.5.32
First: 0.00020954132080078 Second: 0.00020945310592651
Output for 5.5.31
First: 0.00022029876708984 Second: 0.00022514343261719
Output for 5.5.30
First: 0.00018753051757812 Second: 0.00018877506256104
Output for 5.5.29
First: 0.00019625902175903 Second: 0.0002007532119751
Output for 5.5.28
First: 0.00021252870559692 Second: 0.00021039485931396
Output for 5.5.27
First: 0.00022851705551147 Second: 0.00023075103759766
Output for 5.5.26
First: 0.00017721176147461 Second: 0.00017688751220703
Output for 5.5.25
First: 0.00018110990524292 Second: 0.00018141031265259
Output for 5.5.24
First: 0.00023863315582275 Second: 0.00023786544799805
Output for 5.5.23
First: 0.00022143840789795 Second: 0.00022378444671631
Output for 5.5.22
First: 0.00015169858932495 Second: 0.00015167236328125
Output for 5.5.21
First: 0.00020267009735107 Second: 0.00020350456237793
Output for 5.5.20
First: 0.00024481534957886 Second: 0.00024534940719604
Output for 5.5.19
First: 0.00015066385269165 Second: 0.00015047073364258
Output for 5.5.18
First: 0.00029150485992432 Second: 0.0002953028678894
Output for 5.5.16
First: 0.00020221471786499 Second: 0.00020463466644287
Output for 5.5.15
First: 0.00019879579544067 Second: 0.00020243167877197
Output for 5.5.14
First: 0.00017513990402222 Second: 0.00017691373825073
Output for 5.5.13
First: 0.00017833232879639 Second: 0.00017921686172485
Output for 5.5.12
First: 0.00022907495498657 Second: 0.00023048400878906
Output for 5.5.11
First: 0.00015197992324829 Second: 0.00015446901321411
Output for 5.5.10
First: 0.00019158363342285 Second: 0.00019251346588135
Output for 5.5.9
First: 0.00024662256240845 Second: 0.00025505304336548
Output for 5.5.8
First: 0.00019548654556274 Second: 0.00019864797592163
Output for 5.5.7
First: 0.00023104906082153 Second: 0.00023293733596802
Output for 5.5.6
First: 0.00022639989852905 Second: 0.00022897243499756
Output for 5.5.5
First: 0.00023973226547241 Second: 0.00024290800094604
Output for 5.5.4
First: 0.00015472173690796 Second: 0.00015996694564819
Output for 5.5.3
First: 0.00022286891937256 Second: 0.0002257251739502
Output for 5.5.2
First: 0.00014991044998169 Second: 0.00015231847763062
Output for 5.5.1
First: 0.00024212598800659 Second: 0.00023779153823853
Output for 5.5.0
First: 0.00020635604858398 Second: 0.00020602226257324
Output for 5.4.45
First: 0.00020131826400757 Second: 0.00020636558532715
Output for 5.4.44
First: 0.00021432399749756 Second: 0.000216965675354
Output for 5.4.43
First: 0.0002169394493103 Second: 0.0002242374420166
Output for 5.4.42
First: 0.00023576021194458 Second: 0.00023987770080566
Output for 5.4.41
First: 0.0002135181427002 Second: 0.00021597862243652
Output for 5.4.40
First: 0.00014153480529785 Second: 0.00014503955841064
Output for 5.4.39
First: 0.0002323055267334 Second: 0.0002385950088501
Output for 5.4.38
First: 0.00019072532653809 Second: 0.00019363641738892
Output for 5.4.37
First: 0.00020718574523926 Second: 0.00021158933639526
Output for 5.4.36
First: 0.00021951675415039 Second: 0.00022444248199463
Output for 5.4.35
First: 0.00022865295410156 Second: 0.00023295164108276
Output for 5.4.34
First: 0.00021448135375977 Second: 0.00021849870681763
Output for 5.4.32
First: 0.0001451849937439 Second: 0.0001513147354126
Output for 5.4.31
First: 0.00020985126495361 Second: 0.00021362066268921
Output for 5.4.30
First: 0.00021299839019775 Second: 0.00022045135498047
Output for 5.4.29
First: 0.00021374940872192 Second: 0.00020816087722778
Output for 5.4.28
First: 0.00023584365844727 Second: 0.00022979497909546
Output for 5.4.27
First: 0.0001991081237793 Second: 0.00019079446792603
Output for 5.4.26
First: 0.00015091419219971 Second: 0.00014715194702148
Output for 5.4.25
First: 0.00015002965927124 Second: 0.00014532804489136
Output for 5.4.24
First: 0.00020208597183228 Second: 0.00020036220550537
Output for 5.4.23
First: 0.00015383005142212 Second: 0.00014829158782959
Output for 5.4.22
First: 0.00023193359375 Second: 0.00022713184356689
Output for 5.4.21
First: 0.00015364646911621 Second: 0.00015000581741333
Output for 5.4.20
First: 0.00015649557113647 Second: 0.00014892101287842
Output for 5.4.19
First: 0.00016874551773071 Second: 0.00016567468643188
Output for 5.4.18
First: 0.00023539543151855 Second: 0.00023522615432739
Output for 5.4.17
First: 0.00015273571014404 Second: 0.00015378475189209
Output for 5.4.16
First: 0.00014946222305298 Second: 0.00015290021896362
Output for 5.4.15
First: 0.00016742706298828 Second: 0.00016840696334839
Output for 5.4.14
First: 0.00022583246231079 Second: 0.00022835254669189
Output for 5.4.13
First: 0.00022995471954346 Second: 0.00022845506668091
Output for 5.4.12
First: 0.00017874956130981 Second: 0.00017959833145142
Output for 5.4.11
First: 0.0002005410194397 Second: 0.00020253658294678
Output for 5.4.10
First: 0.00018721103668213 Second: 0.00018916368484497
Output for 5.4.9
First: 0.00022174119949341 Second: 0.00022300958633423
Output for 5.4.8
First: 0.00021633386611938 Second: 0.00021790981292725
Output for 5.4.7
First: 0.00019233465194702 Second: 0.00019277095794678
Output for 5.4.6
First: 0.0002239203453064 Second: 0.00022974014282227
Output for 5.4.5
First: 0.00022297382354736 Second: 0.00022474765777588
Output for 5.4.4
First: 0.000199875831604 Second: 0.00020241022109985
Output for 5.4.3
First: 0.00019640445709229 Second: 0.00019763231277466
Output for 5.4.2
First: 0.00022737979888916 Second: 0.0002324366569519
Output for 5.4.1
First: 0.00022897958755493 Second: 0.0002321195602417
Output for 5.4.0
First: 0.00021852970123291 Second: 0.00022882699966431
Output for 5.3.29
First: 0.00025896787643433 Second: 0.00024571657180786
Output for 5.3.28
First: 0.00022804021835327 Second: 0.00022331476211548
Output for 5.3.27
First: 0.00028355360031128 Second: 0.00027109384536743
Output for 5.3.26
First: 0.00028032302856445 Second: 0.00027117729187012
Output for 5.3.25
First: 0.00021985054016113 Second: 0.00021804094314575
Output for 5.3.24
First: 0.00021672964096069 Second: 0.00020508766174316
Output for 5.3.23
First: 0.00030294418334961 Second: 0.0002913498878479
Output for 5.3.22
First: 0.00025125741958618 Second: 0.00024039030075073
Output for 5.3.21
First: 0.00027433633804321 Second: 0.00026335954666138
Output for 5.3.20
First: 0.00029023885726929 Second: 0.00027744770050049
Output for 5.3.19
First: 0.00019632816314697 Second: 0.00018666505813599
Output for 5.3.18
First: 0.00030378341674805 Second: 0.00028963327407837
Output for 5.3.17
First: 0.00023708581924438 Second: 0.00022596836090088
Output for 5.3.16
First: 0.00030092000961304 Second: 0.00028676509857178
Output for 5.3.15
First: 0.00030725240707397 Second: 0.00029377698898315
Output for 5.3.14
First: 0.00026963472366333 Second: 0.00025156021118164
Output for 5.3.13
First: 0.0002384614944458 Second: 0.00023011445999146
Output for 5.3.12
First: 0.00029114246368408 Second: 0.00027659177780151
Output for 5.3.11
First: 0.00024829387664795 Second: 0.00023434162139893
Output for 5.3.10
First: 0.00028820991516113 Second: 0.00027623414993286
Output for 5.3.9
First: 0.00032301902770996 Second: 0.00030292272567749
Output for 5.3.8
First: 0.00031015157699585 Second: 0.0002908992767334
Output for 5.3.7
First: 0.0003154182434082 Second: 0.00029395341873169
Output for 5.3.6
First: 0.00030105113983154 Second: 0.00028873920440674
Output for 5.3.5
First: 0.00030622005462646 Second: 0.00029121875762939
Output for 5.3.4
First: 0.00031830310821533 Second: 0.00029996156692505
Output for 5.3.3
First: 0.00028677463531494 Second: 0.00027884006500244
Output for 5.3.2
First: 0.00023809671401978 Second: 0.00022626399993896
Output for 5.3.1
First: 0.00023436307907104 Second: 0.0002257251739502
Output for 5.3.0
First: 0.00030534982681274 Second: 0.00029061794281006
Output for 5.2.17
First: 0.0002260684967041 Second: 0.00020714282989502
Output for 5.2.16
First: 0.00018492460250854 Second: 0.00016621589660645
Output for 5.2.15
First: 0.00030868053436279 Second: 0.00027841329574585
Output for 5.2.14
First: 0.00027907133102417 Second: 0.00025537729263306
Output for 5.2.13
First: 0.0003201699256897 Second: 0.00028740644454956
Output for 5.2.12
First: 0.00032014131546021 Second: 0.00029007911682129
Output for 5.2.11
First: 0.00031499862670898 Second: 0.00028595209121704
Output for 5.2.10
First: 0.00033718824386597 Second: 0.00029776811599731
Output for 5.2.9
First: 0.00026517391204834 Second: 0.00024566173553467
Output for 5.2.8
First: 0.00031513214111328 Second: 0.00029103517532349
Output for 5.2.7
First: 0.00018520355224609 Second: 0.00017184734344482
Output for 5.2.6
First: 0.00028333425521851 Second: 0.00025599479675293
Output for 5.2.5
First: 0.00029337167739868 Second: 0.00026521682739258
Output for 5.2.4
First: 0.00025788307189941 Second: 0.00023627519607544
Output for 5.2.3
First: 0.0002656364440918 Second: 0.00024475336074829
Output for 5.2.2
First: 0.00029962301254272 Second: 0.00025598287582397
Output for 5.2.1
First: 0.00033982992172241 Second: 0.00030059099197388
Output for 5.2.0
First: 0.00029070377349854 Second: 0.0002643346786499
Output for 5.1.6
First: 0.00020281314849854 Second: 0.00016892194747925
Output for 5.1.5
First: 0.00026058673858643 Second: 0.00022001504898071
Output for 5.1.4
First: 0.0002797269821167 Second: 0.0002480411529541
Output for 5.1.3
First: 0.00033164501190186 Second: 0.0002887487411499
Output for 5.1.2
First: 0.00029292345046997 Second: 0.00026091575622559
Output for 5.1.1
First: 0.00028331995010376 Second: 0.00024879455566406
Output for 5.1.0
First: 0.00029304265975952 Second: 0.00025141716003418
Output for 5.0.5
First: 0.00052794933319092 Second: 0.00049487829208374
Output for 5.0.4
First: 0.00055246114730835 Second: 0.00052095890045166
Output for 5.0.3
First: 0.0004610276222229 Second: 0.00043081521987915
Output for 5.0.2
First: 0.00053736925125122 Second: 0.00049270153045654
Output for 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/N56k8 on line 26 First: 0.00051033973693848PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/N56k8 on line 27 Second: 0.00046851873397827PHP_EOL
Output for 5.0.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/N56k8 on line 26 First: 0.00047486543655396PHP_EOL Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/N56k8 on line 27 Second: 0.00044331550598145PHP_EOL
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /in/N56k8 on line 19
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/N56k8 on line 19
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /in/N56k8 on line 19
Process exited with code 255.