3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function test1() { $str = 'derp'; if ($str != 'files' && $str != 'something' && $str != 'Derrr') { return; } return; } function test2() { $str = 'derp'; switch ($str) { case 'files': case 'something': case 'Derrr': break; default: return; } return; } $start1 = microtime(1); for ($i = 1; $i < 10000; $i++) { test1(); } $start1 -= microtime(1); echo "test1: $start1"; $start2 = microtime(1); for ($i = 1; $i < 10000; $i++) { test2(); } $start2 -= microtime(1); echo "\ntest2: $start2"; if ($start1 < $start2) { $perc = round(($start2 / $start1) * 100,2)-100; echo "Test1 is $perc faster than Test2"; } if ($start2 < $start2) { $perc = round(($start1 / $start2) * 100,2)-100; echo "Test2 is $perc faster than Test1"; }
Output for 7.1.0
test1: -0.0011889934539795 test2: -0.00087189674377441Test1 is -26.67 faster than Test2
Output for 7.0.14
test1: -0.0013351440429688 test2: -0.0008699893951416Test1 is -34.84 faster than Test2
Output for 7.0.10
test1: -0.00055408477783203 test2: -0.0004570484161377Test1 is -17.51 faster than Test2
Output for 7.0.9
test1: -0.00075793266296387 test2: -0.0006260871887207Test1 is -17.4 faster than Test2
Output for 7.0.8
test1: -0.00051188468933105 test2: -0.00039911270141602Test1 is -22.03 faster than Test2
Output for 7.0.7
test1: -0.0006110668182373 test2: -0.00047898292541504Test1 is -21.62 faster than Test2
Output for 7.0.6
test1: -0.00059008598327637 test2: -0.0004570484161377Test1 is -22.55 faster than Test2
Output for 7.0.5
test1: -0.00055193901062012 test2: -0.00043106079101562Test1 is -21.9 faster than Test2
Output for 7.0.4
test1: -0.00081205368041992 test2: -0.00065898895263672Test1 is -18.85 faster than Test2
Output for 7.0.3
test1: -0.00069594383239746 test2: -0.00046896934509277Test1 is -32.61 faster than Test2
Output for 7.0.2
test1: -0.00064992904663086 test2: -0.0005340576171875Test1 is -17.83 faster than Test2
Output for 7.0.1
test1: -0.00070595741271973 test2: -0.00053811073303223Test1 is -23.78 faster than Test2
Output for 7.0.0
test1: -0.00055313110351562 test2: -0.00042915344238281Test1 is -22.41 faster than Test2
Output for 5.6.25
test1: -0.0020668506622314 test2: -0.0024449825286865
Output for 5.6.24
test1: -0.0021171569824219 test2: -0.0026538372039795
Output for 5.6.23
test1: -0.0024619102478027 test2: -0.0031149387359619
Output for 5.6.22
test1: -0.0021789073944092 test2: -0.0030081272125244
Output for 5.6.21
test1: -0.0022590160369873 test2: -0.0027279853820801
Output for 5.6.20
test1: -0.0024628639221191 test2: -0.0029540061950684
Output for 5.6.19
test1: -0.0029220581054688 test2: -0.0033998489379883
Output for 5.6.18
test1: -0.0020899772644043 test2: -0.0035169124603271
Output for 5.6.17
test1: -0.0030159950256348 test2: -0.003619909286499
Output for 5.6.16
test1: -0.0020699501037598 test2: -0.0025179386138916
Output for 5.6.15
test1: -0.0028588771820068 test2: -0.003446102142334
Output for 5.6.14
test1: -0.0021581649780273 test2: -0.0025720596313477
Output for 5.6.13
test1: -0.0024168491363525 test2: -0.002173900604248Test1 is -10.05 faster than Test2
Output for 5.6.12
test1: -0.0030169486999512 test2: -0.0035820007324219
Output for 5.6.11
test1: -0.0025269985198975 test2: -0.0026500225067139
Output for 5.6.10
test1: -0.0021350383758545 test2: -0.0025849342346191
Output for 5.6.9
test1: -0.0028219223022461 test2: -0.0033431053161621
Output for 5.6.8
test1: -0.0021920204162598 test2: -0.0026280879974365
Output for 5.6.7
test1: -0.0020971298217773 test2: -0.0025129318237305
Output for 5.6.6
test1: -0.0026249885559082 test2: -0.0032050609588623
Output for 5.6.5
test1: -0.002100944519043 test2: -0.0025250911712646
Output for 5.6.4
test1: -0.001863956451416 test2: -0.0023620128631592
Output for 5.6.3
test1: -0.003209114074707 test2: -0.0039288997650146
Output for 5.6.2
test1: -0.0022010803222656 test2: -0.0026819705963135
Output for 5.6.1
test1: -0.0020618438720703 test2: -0.0024821758270264
Output for 5.6.0
test1: -0.0030708312988281 test2: -0.0036659240722656
Output for 5.5.38
test1: -0.0020370483398438 test2: -0.0021679401397705
Output for 5.5.37
test1: -0.0029439926147461 test2: -0.0036380290985107
Output for 5.5.36
test1: -0.002284049987793 test2: -0.0031249523162842
Output for 5.5.35
test1: -0.0023748874664307 test2: -0.0028340816497803
Output for 5.5.34
test1: -0.0022261142730713 test2: -0.0024478435516357
Output for 5.5.33
test1: -0.0027620792388916 test2: -0.0033740997314453
Output for 5.5.32
test1: -0.0025210380554199 test2: -0.0031499862670898
Output for 5.5.31
test1: -0.0037047863006592 test2: -0.0031571388244629Test1 is -14.78 faster than Test2
Output for 5.5.30
test1: -0.0017800331115723 test2: -0.0022909641265869
Output for 5.5.29
test1: -0.002877950668335 test2: -0.0034999847412109
Output for 5.5.28
test1: -0.0031619071960449 test2: -0.0037920475006104
Output for 5.5.27
test1: -0.0021209716796875 test2: -0.0026278495788574
Output for 5.5.26
test1: -0.0022690296173096 test2: -0.0025169849395752
Output for 5.5.25
test1: -0.0021572113037109 test2: -0.0026381015777588
Output for 5.5.24
test1: -0.0026009082794189 test2: -0.0033340454101562
Output for 5.5.23
test1: -0.0019979476928711 test2: -0.0025548934936523
Output for 5.5.22
test1: -0.0028200149536133 test2: -0.0034031867980957
Output for 5.5.21
test1: -0.0025510787963867 test2: -0.0031299591064453
Output for 5.5.20
test1: -0.002039909362793 test2: -0.0024709701538086
Output for 5.5.19
test1: -0.0026030540466309 test2: -0.002979040145874
Output for 5.5.18
test1: -0.0025749206542969 test2: -0.0031280517578125
Output for 5.5.16
test1: -0.0027809143066406 test2: -0.0033590793609619
Output for 5.5.15
test1: -0.0026609897613525 test2: -0.0031161308288574
Output for 5.5.14
test1: -0.0026140213012695 test2: -0.0032320022583008
Output for 5.5.13
test1: -0.0018839836120605 test2: -0.0021848678588867
Output for 5.5.12
test1: -0.0017940998077393 test2: -0.0021758079528809
Output for 5.5.11
test1: -0.0016698837280273 test2: -0.0020279884338379
Output for 5.5.10
test1: -0.0018229484558105 test2: -0.0021669864654541
Output for 5.5.9
test1: -0.0017781257629395 test2: -0.0021648406982422
Output for 5.5.8
test1: -0.0017759799957275 test2: -0.0020740032196045
Output for 5.5.7
test1: -0.0017950534820557 test2: -0.0021750926971436
Output for 5.5.6
test1: -0.001741886138916 test2: -0.0021779537200928
Output for 5.5.5
test1: -0.0019128322601318 test2: -0.0023329257965088
Output for 5.5.4
test1: -0.001823902130127 test2: -0.0021359920501709
Output for 5.5.3
test1: -0.0017349720001221 test2: -0.002173900604248
Output for 5.5.2
test1: -0.0016689300537109 test2: -0.0021770000457764
Output for 5.5.1
test1: -0.0016829967498779 test2: -0.0021860599517822
Output for 5.5.0
test1: -0.0016889572143555 test2: -0.0021841526031494
Output for 5.4.45
test1: -0.0026419162750244 test2: -0.0025858879089355Test1 is -2.12 faster than Test2
Output for 5.4.44
test1: -0.0019521713256836 test2: -0.0024089813232422
Output for 5.4.43
test1: -0.0018360614776611 test2: -0.0022599697113037
Output for 5.4.42
test1: -0.0023429393768311 test2: -0.0029969215393066
Output for 5.4.41
test1: -0.0024120807647705 test2: -0.0029878616333008
Output for 5.4.40
test1: -0.0024640560150146 test2: -0.0030190944671631
Output for 5.4.39
test1: -0.0024700164794922 test2: -0.0031259059906006
Output for 5.4.38
test1: -0.0019071102142334 test2: -0.002338171005249
Output for 5.4.37
test1: -0.0023159980773926 test2: -0.0027179718017578
Output for 5.4.36
test1: -0.0017139911651611 test2: -0.003148078918457
Output for 5.4.35
test1: -0.0031189918518066 test2: -0.0036931037902832
Output for 5.4.34
test1: -0.0022292137145996 test2: -0.0027649402618408
Output for 5.4.32
test1: -0.0028398036956787 test2: -0.0034699440002441
Output for 5.4.31
test1: -0.0031390190124512 test2: -0.0037119388580322
Output for 5.4.30
test1: -0.0017180442810059 test2: -0.002345085144043
Output for 5.4.29
test1: -0.0017440319061279 test2: -0.0022029876708984
Output for 5.4.28
test1: -0.0017859935760498 test2: -0.002288818359375
Output for 5.4.27
test1: -0.0018048286437988 test2: -0.0022568702697754
Output for 5.4.26
test1: -0.0016989707946777 test2: -0.0021018981933594
Output for 5.4.25
test1: -0.0020508766174316 test2: -0.0022420883178711
Output for 5.4.24
test1: -0.0018517971038818 test2: -0.0022728443145752
Output for 5.4.23
test1: -0.0019049644470215 test2: -0.0021498203277588
Output for 5.4.22
test1: -0.0018692016601562 test2: -0.0021529197692871
Output for 5.4.21
test1: -0.0017910003662109 test2: -0.0021898746490479
Output for 5.4.20
test1: -0.0017359256744385 test2: -0.0029709339141846
Output for 5.4.19
test1: -0.0020139217376709 test2: -0.002385139465332
Output for 5.4.18
test1: -0.0017349720001221 test2: -0.002047061920166
Output for 5.4.17
test1: -0.0018980503082275 test2: -0.0022158622741699
Output for 5.4.16
test1: -0.0016899108886719 test2: -0.0021929740905762
Output for 5.4.15
test1: -0.0016601085662842 test2: -0.0019059181213379
Output for 5.4.14
test1: -0.0017170906066895 test2: -0.0021259784698486
Output for 5.4.13
test1: -0.0016958713531494 test2: -0.0021770000457764
Output for 5.4.12
test1: -0.0015189647674561 test2: -0.0020990371704102
Output for 5.4.11
test1: -0.0017681121826172 test2: -0.0022258758544922
Output for 5.4.10
test1: -0.0021371841430664 test2: -0.0021500587463379
Output for 5.4.9
test1: -0.0016679763793945 test2: -0.0021789073944092
Output for 5.4.8
test1: -0.0016820430755615 test2: -0.0021460056304932
Output for 5.4.7
test1: -0.0016469955444336 test2: -0.0022389888763428
Output for 5.4.6
test1: -0.0016889572143555 test2: -0.0020289421081543
Output for 5.4.5
test1: -0.0023331642150879 test2: -0.0028760433197021
Output for 5.4.4
test1: -0.0017178058624268 test2: -0.0021538734436035
Output for 5.4.3
test1: -0.0021679401397705 test2: -0.0035910606384277
Output for 5.4.2
test1: -0.0016610622406006 test2: -0.0020220279693604
Output for 5.4.1
test1: -0.0028970241546631 test2: -0.0035679340362549
Output for 5.4.0
test1: -0.0021729469299316 test2: -0.0028331279754639
Output for 5.3.29
test1: -0.0043189525604248 test2: -0.0041770935058594Test1 is -3.28 faster than Test2
Output for 5.3.28
test1: -0.0025279521942139 test2: -0.0025119781494141Test1 is -0.63 faster than Test2
Output for 5.3.27
test1: -0.0024950504302979 test2: -0.0024330615997314Test1 is -2.48 faster than Test2
Output for 5.3.26
test1: -0.0038750171661377 test2: -0.0038199424743652Test1 is -1.42 faster than Test2
Output for 5.3.25
test1: -0.002251148223877 test2: -0.0021531581878662Test1 is -4.35 faster than Test2
Output for 5.3.24
test1: -0.0027279853820801 test2: -0.0031731128692627
Output for 5.3.23
test1: -0.0026760101318359 test2: -0.0028591156005859
Output for 5.3.22
test1: -0.0026230812072754 test2: -0.0025238990783691Test1 is -3.78 faster than Test2
Output for 5.3.21
test1: -0.0026280879974365 test2: -0.0024778842926025Test1 is -5.72 faster than Test2
Output for 5.3.20
test1: -0.0031569004058838 test2: -0.0029380321502686Test1 is -6.93 faster than Test2
Output for 5.3.19
test1: -0.0033490657806396 test2: -0.0032157897949219Test1 is -3.98 faster than Test2
Output for 5.3.18
test1: -0.0026159286499023 test2: -0.0024960041046143Test1 is -4.58 faster than Test2
Output for 5.3.17
test1: -0.0026791095733643 test2: -0.0025720596313477Test1 is -4 faster than Test2
Output for 5.3.16
test1: -0.0025670528411865 test2: -0.0024268627166748Test1 is -5.46 faster than Test2
Output for 5.3.15
test1: -0.0025718212127686 test2: -0.0024471282958984Test1 is -4.85 faster than Test2
Output for 5.3.14
test1: -0.0023000240325928 test2: -0.002377986907959
Output for 5.3.13
test1: -0.0043098926544189 test2: -0.0040488243103027Test1 is -6.06 faster than Test2
Output for 5.3.12
test1: -0.0045719146728516 test2: -0.0042629241943359Test1 is -6.76 faster than Test2
Output for 5.3.11
test1: -0.003986120223999 test2: -0.0036618709564209Test1 is -8.13 faster than Test2
Output for 5.3.10
test1: -0.0036489963531494 test2: -0.0034220218658447Test1 is -6.22 faster than Test2
Output for 5.3.9
test1: -0.0030591487884521 test2: -0.002716064453125Test1 is -11.22 faster than Test2
Output for 5.3.8
test1: -0.0031678676605225 test2: -0.0030708312988281Test1 is -3.06 faster than Test2
Output for 5.3.7
test1: -0.0043070316314697 test2: -0.0038118362426758Test1 is -11.5 faster than Test2
Output for 5.3.6
test1: -0.0033490657806396 test2: -0.0031981468200684Test1 is -4.51 faster than Test2
Output for 5.3.5
test1: -0.0033020973205566 test2: -0.0032098293304443Test1 is -2.79 faster than Test2
Output for 5.3.4
test1: -0.0028619766235352 test2: -0.0030829906463623
Output for 5.3.3
test1: -0.0041968822479248 test2: -0.0039498805999756Test1 is -5.89 faster than Test2
Output for 5.3.2
test1: -0.0037767887115479 test2: -0.0037229061126709Test1 is -1.43 faster than Test2
Output for 5.3.1
test1: -0.0044398307800293 test2: -0.0044410228729248
Output for 5.3.0
test1: -0.0037791728973389 test2: -0.0035948753356934Test1 is -4.88 faster than Test2
Output for 5.2.17
test1: -0.0066540241241455 test2: -0.0060200691223145Test1 is -9.53 faster than Test2
Output for 5.2.16
test1: -0.0065898895263672 test2: -0.0060079097747803Test1 is -8.83 faster than Test2
Output for 5.2.15
test1: -0.0078461170196533 test2: -0.0068690776824951Test1 is -12.45 faster than Test2
Output for 5.2.14
test1: -0.0051519870758057 test2: -0.0049481391906738Test1 is -3.96 faster than Test2
Output for 5.2.13
test1: -0.006742000579834 test2: -0.0063121318817139Test1 is -6.38 faster than Test2
Output for 5.2.12
test1: -0.0066440105438232 test2: -0.0075418949127197
Output for 5.2.11
test1: -0.0052540302276611 test2: -0.0052831172943115
Output for 5.2.10
test1: -0.0041911602020264 test2: -0.0037789344787598Test1 is -9.84 faster than Test2
Output for 5.2.9
test1: -0.0068459510803223 test2: -0.0063149929046631Test1 is -7.76 faster than Test2
Output for 5.2.8
test1: -0.0054938793182373 test2: -0.005101203918457Test1 is -7.15 faster than Test2
Output for 5.2.7
test1: -0.0056328773498535 test2: -0.0051910877227783Test1 is -7.84 faster than Test2
Output for 5.2.6
test1: -0.0047740936279297 test2: -0.0050811767578125
Output for 5.2.5
test1: -0.0052311420440674 test2: -0.0037941932678223Test1 is -27.47 faster than Test2
Output for 5.2.4
test1: -0.0044059753417969 test2: -0.0038070678710938Test1 is -13.59 faster than Test2
Output for 5.2.3
test1: -0.0073971748352051 test2: -0.006148099899292Test1 is -16.89 faster than Test2
Output for 5.2.2
test1: -0.0072081089019775 test2: -0.0064969062805176Test1 is -9.87 faster than Test2
Output for 5.2.1
test1: -0.0074758529663086 test2: -0.0067019462585449Test1 is -10.35 faster than Test2
Output for 5.2.0
test1: -0.0068140029907227 test2: -0.0062408447265625Test1 is -8.41 faster than Test2
Output for 5.1.6
test1: -0.0079820156097412 test2: -0.007875919342041Test1 is -1.33 faster than Test2
Output for 5.1.5
test1: -0.008307933807373 test2: -0.0076580047607422Test1 is -7.82 faster than Test2
Output for 5.1.4
test1: -0.0061800479888916 test2: -0.0058350563049316Test1 is -5.58 faster than Test2
Output for 5.1.3
test1: -0.0046849250793457 test2: -0.0043611526489258Test1 is -6.91 faster than Test2
Output for 5.1.2
test1: -0.0044739246368408 test2: -0.0041489601135254Test1 is -7.26 faster than Test2
Output for 5.1.1
test1: -0.0084948539733887 test2: -0.0073058605194092Test1 is -14 faster than Test2
Output for 5.1.0
test1: -0.0081360340118408 test2: -0.0070528984069824Test1 is -13.31 faster than Test2
Output for 5.0.5
test1: -0.0063979625701904 test2: -0.0081429481506348
Output for 5.0.4
test1: -0.0072028636932373 test2: -0.0054430961608887Test1 is -24.43 faster than Test2
Output for 5.0.3
test1: -0.0055270195007324 test2: -0.0052800178527832Test1 is -4.47 faster than Test2
Output for 5.0.2
test1: -0.010795831680298 test2: -0.0096509456634521Test1 is -10.6 faster than Test2
Output for 5.0.1
test1: -0.0099449157714844 test2: -0.0090031623840332Test1 is -9.47 faster than Test2
Output for 5.0.0
test1: -0.0099029541015625 test2: -0.0094790458679199Test1 is -4.28 faster than Test2
Output for 4.4.9
test1: -0.011874 test2: -0.010371Test1 is -12.66 faster than Test2
Output for 4.4.8
test1: -0.007628 test2: -0.006231Test1 is -18.31 faster than Test2
Output for 4.4.7
test1: -0.010077 test2: -0.009193Test1 is -8.77 faster than Test2
Output for 4.4.6
test1: -0.011303 test2: -0.015216
Output for 4.4.5
test1: -0.010503 test2: -0.009225Test1 is -12.17 faster than Test2
Output for 4.4.4
test1: -0.009628 test2: -0.008481Test1 is -11.91 faster than Test2
Output for 4.4.3
test1: -0.010563 test2: -0.009185Test1 is -13.05 faster than Test2
Output for 4.4.2
test1: -0.010838 test2: -0.008914Test1 is -17.75 faster than Test2
Output for 4.4.1
test1: -0.009894 test2: -0.008569Test1 is -13.39 faster than Test2
Output for 4.4.0
test1: -0.009811 test2: -0.008446Test1 is -13.91 faster than Test2
Output for 4.3.11
test1: -0.009495 test2: -0.008523Test1 is -10.24 faster than Test2
Output for 4.3.10
test1: -0.011132 test2: -0.010524Test1 is -5.46 faster than Test2
Output for 4.3.9
test1: -0.007818 test2: -0.007204Test1 is -7.85 faster than Test2
Output for 4.3.8
test1: -0.011334 test2: -0.010355Test1 is -8.64 faster than Test2
Output for 4.3.7
test1: -0.007258 test2: -0.00659Test1 is -9.2 faster than Test2
Output for 4.3.6
test1: -0.006196 test2: -0.00568Test1 is -8.33 faster than Test2
Output for 4.3.5
test1: -0.013213 test2: -0.011472Test1 is -13.18 faster than Test2
Output for 4.3.4
test1: -0.011033 test2: -0.008201Test1 is -25.67 faster than Test2
Output for 4.3.3
test1: -0.01223 test2: -0.010727Test1 is -12.29 faster than Test2
Output for 4.3.2
test1: -0.011086 test2: -0.008837Test1 is -20.29 faster than Test2
Output for 4.3.1
test1: -0.01077 test2: -0.009393Test1 is -12.79 faster than Test2
Output for 4.3.0
test1: -0.006925 test2: -0.00706