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); } print "Second: " . ($second/$runs) . PHP_EOL;
Output for 7.1.0
Second: 6.6311359405518E-5
Output for 7.0.14
Second: 6.2277317047119E-5
Output for 7.0.6
Second: 5.0156116485596E-5
Output for 7.0.5
Second: 5.8424472808838E-5
Output for 7.0.4
Second: 7.8668594360352E-5
Output for 7.0.3
Second: 4.0569305419922E-5
Output for 7.0.2
Second: 3.6182403564453E-5
Output for 7.0.1
Second: 4.8251152038574E-5
Output for 7.0.0
Second: 3.8630962371826E-5
Output for 5.6.28
Second: 0.00023924589157104
Output for 5.6.21
Second: 0.00021361112594604
Output for 5.6.20
Second: 0.00021695852279663
Output for 5.6.19
Second: 0.00013578653335571
Output for 5.6.18
Second: 0.00014131307601929
Output for 5.6.17
Second: 0.00014123678207397
Output for 5.6.16
Second: 0.00017135858535767
Output for 5.6.15
Second: 0.00021988868713379
Output for 5.6.14
Second: 0.00021669864654541
Output for 5.6.13
Second: 0.00017449617385864
Output for 5.6.12
Second: 0.0001442551612854
Output for 5.6.11
Second: 0.00021847724914551
Output for 5.6.10
Second: 0.00019812822341919
Output for 5.6.9
Second: 0.00021014213562012
Output for 5.6.8
Second: 0.00018979072570801
Output for 5.6.7
Second: 0.00015848875045776
Output for 5.5.35
Second: 0.00020368337631226
Output for 5.5.34
Second: 0.00017512559890747
Output for 5.5.33
Second: 0.00015003204345703
Output for 5.5.32
Second: 0.00020786046981812
Output for 5.5.31
Second: 0.00019400835037231
Output for 5.5.30
Second: 0.00015728235244751
Output for 5.5.29
Second: 0.00020642995834351
Output for 5.5.28
Second: 0.00015361785888672
Output for 5.5.27
Second: 0.00020032167434692
Output for 5.5.26
Second: 0.00015849590301514
Output for 5.5.25
Second: 0.00022715330123901
Output for 5.5.24
Second: 0.00021571636199951
Output for 5.4.45
Second: 0.00011859655380249
Output for 5.4.44
Second: 0.00013779401779175
Output for 5.4.43
Second: 0.000228111743927
Output for 5.4.42
Second: 0.00021497488021851
Output for 5.4.41
Second: 0.00027976512908936
Output for 5.4.40
Second: 0.00024214506149292
Output for 5.4.39
Second: 0.00036884307861328
Output for 5.4.38
Second: 0.00022096395492554
Output for 5.4.37
Second: 0.00041415929794312
Output for 5.4.36
Second: 0.00041268587112427
Output for 5.4.35
Second: 0.00024461269378662
Output for 5.4.34
Second: 0.00022839546203613
Output for 5.4.32
Second: 0.00015735864639282
Output for 5.4.31
Second: 0.00019026756286621
Output for 5.4.30
Second: 0.00018232345581055
Output for 5.4.29
Second: 0.00017719268798828
Output for 5.4.28
Second: 0.00015769004821777
Output for 5.4.27
Second: 0.00018568515777588
Output for 5.4.26
Second: 0.00017132520675659
Output for 5.4.25
Second: 0.00015358209609985
Output for 5.4.24
Second: 0.00016869783401489
Output for 5.4.23
Second: 0.00015482187271118
Output for 5.4.22
Second: 0.0001788854598999
Output for 5.4.21
Second: 0.00021251440048218
Output for 5.4.20
Second: 0.00015325784683228
Output for 5.4.19
Second: 0.00016858816146851
Output for 5.4.18
Second: 0.0002315878868103
Output for 5.4.17
Second: 0.00022097826004028
Output for 5.4.16
Second: 0.00018214464187622
Output for 5.4.15
Second: 0.00018666505813599
Output for 5.4.14
Second: 0.00019790649414063
Output for 5.4.13
Second: 0.00017903089523315
Output for 5.4.12
Second: 0.00019030094146729
Output for 5.4.11
Second: 0.00022167444229126
Output for 5.4.10
Second: 0.00021412134170532
Output for 5.4.9
Second: 0.00021687507629395
Output for 5.4.8
Second: 0.00019461631774902
Output for 5.4.7
Second: 0.00019982099533081
Output for 5.4.6
Second: 0.00024851322174072
Output for 5.4.5
Second: 0.00024134159088135
Output for 5.4.4
Second: 0.00018867254257202
Output for 5.4.3
Second: 0.00021006345748901
Output for 5.4.2
Second: 0.0001993727684021
Output for 5.4.1
Second: 0.00024707555770874
Output for 5.4.0
Second: 0.00021404981613159
Output for 5.3.29
Second: 0.00021801948547363
Output for 5.3.28
Second: 0.00019137620925903
Output for 5.3.27
Second: 0.00023506641387939
Output for 5.3.26
Second: 0.00058648347854614
Output for 5.3.25
Second: 0.00023746490478516
Output for 5.3.24
Second: 0.00026955604553223
Output for 5.3.23
Second: 0.00023112058639526
Output for 5.3.22
Second: 0.00025601625442505
Output for 5.3.21
Second: 0.00028423070907593
Output for 5.3.20
Second: 0.00030608415603638
Output for 5.3.19
Second: 0.00028900384902954
Output for 5.3.18
Second: 0.00029393196105957
Output for 5.3.17
Second: 0.00030435800552368
Output for 5.3.16
Second: 0.00028077602386475
Output for 5.3.15
Second: 0.00028884649276733
Output for 5.3.14
Second: 0.00026775360107422
Output for 5.3.13
Second: 0.00027028560638428
Output for 5.3.12
Second: 0.00092741250991821
Output for 5.3.11
Second: 0.00028560638427734
Output for 5.3.10
Second: 0.00028105974197388
Output for 5.3.9
Second: 0.00026371955871582
Output for 5.3.8
Second: 0.00025915861129761
Output for 5.3.7
Second: 0.00027125835418701
Output for 5.3.6
Second: 0.00024288415908813
Output for 5.3.5
Second: 0.00023378372192383
Output for 5.3.4
Second: 0.00028115510940552
Output for 5.3.3
Second: 0.00025463819503784
Output for 5.3.2
Second: 0.00024566650390625
Output for 5.3.1
Second: 0.00027670860290527
Output for 5.3.0
Second: 0.00027366399765015
Output for 5.2.17
Second: 0.00023262977600098
Output for 5.2.16
Second: 0.00022876501083374
Output for 5.2.15
Second: 0.00023125171661377
Output for 5.2.14
Second: 0.00023115158081055
Output for 5.2.13
Second: 0.00022257089614868
Output for 5.2.12
Second: 0.00023055553436279
Output for 5.2.11
Second: 0.00023386001586914
Output for 5.2.10
Second: 0.00022603034973145
Output for 5.2.9
Second: 0.00024014711380005
Output for 5.2.8
Second: 0.00024255752563477
Output for 5.2.7
Second: 0.00027061462402344
Output for 5.2.6
Second: 0.00021799087524414
Output for 5.2.5
Second: 0.00022662878036499
Output for 5.2.4
Second: 0.0002301287651062
Output for 5.2.3
Second: 0.00020819187164307
Output for 5.2.2
Second: 0.00023335218429565
Output for 5.2.1
Second: 0.00022383689880371
Output for 5.2.0
Second: 0.00027008771896362
Output for 5.1.6
Second: 0.00019735336303711
Output for 5.1.5
Second: 0.00052361965179443
Output for 5.1.4
Second: 0.00021425247192383
Output for 5.1.3
Second: 0.00022441864013672
Output for 5.1.2
Second: 0.00021450519561768
Output for 5.1.1
Second: 0.0001982569694519
Output for 5.1.0
Second: 0.00019811153411865
Output for 5.0.5
Second: 0.00044579982757568
Output for 5.0.4
Second: 0.00046143054962158
Output for 5.0.3
Second: 0.00043554067611694
Output for 5.0.2
Second: 0.00044380187988281
Output for 5.0.1
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/89Hk4 on line 18 Second: 0.00044739484786987PHP_EOL
Output for 5.0.0
Notice: Use of undefined constant PHP_EOL - assumed 'PHP_EOL' in /in/89Hk4 on line 18 Second: 0.00041667938232422PHP_EOL
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected '&', expecting T_VARIABLE or '$' in /in/89Hk4 on line 11
Process exited with code 255.
Output for 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /in/89Hk4 on line 11
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_VARIABLE' or `'$'' in /in/89Hk4 on line 11
Process exited with code 255.
Output for 4.3.0
Parse error: parse error, unexpected '&', expecting T_VARIABLE or '$' in /in/ENFVo on line 11
Process exited with code 255.