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; } $start = microtime(1); for ($i = 1; $i < 10000; $i++) { test1(); } $start -= microtime(1); echo "test1: $start"; $start = microtime(1); for ($i = 1; $i < 10000; $i++) { test2(); } $start -= microtime(1); echo "test2: $start";
Output for 7.1.0
test1: -0.0012290477752686test2: -0.00092697143554688
Output for 7.0.14
test1: -0.0013611316680908test2: -0.00091791152954102
Output for 7.0.10
test1: -0.00061893463134766test2: -0.00052785873413086
Output for 7.0.9
test1: -0.00053215026855469test2: -0.00043201446533203
Output for 7.0.8
test1: -0.00064682960510254test2: -0.00049400329589844
Output for 7.0.7
test1: -0.00077700614929199test2: -0.00063490867614746
Output for 7.0.6
test1: -0.00077700614929199test2: -0.00066518783569336
Output for 7.0.5
test1: -0.00077080726623535test2: -0.00067687034606934
Output for 7.0.4
test1: -0.00069594383239746test2: -0.0005650520324707
Output for 7.0.3
test1: -0.00069904327392578test2: -0.00055503845214844
Output for 7.0.2
test1: -0.00049591064453125test2: -0.00037193298339844
Output for 7.0.1
test1: -0.0006251335144043test2: -0.00046896934509277
Output for 7.0.0
test1: -0.00058197975158691test2: -0.0004270076751709
Output for hhvm-3.12.0
test1: -0.0036830902099609test2: -0.0048408508300781
Output for hhvm-3.10.0
test1: -0.0044500827789307test2: -0.0045590400695801
Output for 5.6.28
test1: -0.0034909248352051test2: -0.0031599998474121
Output for 5.6.25
test1: -0.002007007598877test2: -0.0020778179168701
Output for 5.6.24
test1: -0.00301194190979test2: -0.0036859512329102
Output for 5.6.23
test1: -0.0022640228271484test2: -0.0028080940246582
Output for 5.6.22
test1: -0.0024418830871582test2: -0.0031499862670898
Output for 5.6.21
test1: -0.0018250942230225test2: -0.0022659301757812
Output for 5.6.20
test1: -0.0022821426391602test2: -0.0027790069580078
Output for 5.6.19
test1: -0.0026600360870361test2: -0.0031239986419678
Output for 5.6.18
test1: -0.0030348300933838test2: -0.0036427974700928
Output for 5.6.17
test1: -0.0028369426727295test2: -0.0046298503875732
Output for 5.6.16
test1: -0.0018258094787598test2: -0.0021870136260986
Output for 5.6.15
test1: -0.0026049613952637test2: -0.0030951499938965
Output for 5.6.14
test1: -0.0030510425567627test2: -0.0036110877990723
Output for 5.6.13
test1: -0.0028278827667236test2: -0.0034158229827881
Output for 5.6.12
test1: -0.0028078556060791test2: -0.0034940242767334
Output for 5.6.11
test1: -0.0024969577789307test2: -0.0029470920562744
Output for 5.6.10
test1: -0.0028350353240967test2: -0.0033800601959229
Output for 5.6.9
test1: -0.0030519962310791test2: -0.0032939910888672
Output for 5.6.8
test1: -0.0030970573425293test2: -0.0028479099273682
Output for 5.6.7
test1: -0.0035300254821777test2: -0.0038628578186035
Output for 5.6.6
test1: -0.0032899379730225test2: -0.00323486328125
Output for 5.6.5
test1: -0.0023899078369141test2: -0.0028228759765625
Output for 5.6.4
test1: -0.0028939247131348test2: -0.0033941268920898
Output for 5.6.3
test1: -0.0029699802398682test2: -0.0037767887115479
Output for 5.6.2
test1: -0.0030028820037842test2: -0.0036618709564209
Output for 5.6.1
test1: -0.0023660659790039test2: -0.0029551982879639
Output for 5.6.0
test1: -0.0028350353240967test2: -0.00331711769104
Output for 5.5.38
test1: -0.0026087760925293test2: -0.0034029483795166
Output for 5.5.37
test1: -0.0023751258850098test2: -0.0031039714813232
Output for 5.5.36
test1: -0.001676082611084test2: -0.00325608253479
Output for 5.5.35
test1: -0.0023880004882812test2: -0.0027899742126465
Output for 5.5.34
test1: -0.0038411617279053test2: -0.003709077835083
Output for 5.5.33
test1: -0.0023698806762695test2: -0.0030341148376465
Output for 5.5.32
test1: -0.0028901100158691test2: -0.0034298896789551
Output for 5.5.31
test1: -0.0029850006103516test2: -0.0036180019378662
Output for 5.5.30
test1: -0.0025739669799805test2: -0.003432035446167
Output for 5.5.29
test1: -0.0029828548431396test2: -0.0036110877990723
Output for 5.5.28
test1: -0.0025029182434082test2: -0.003115177154541
Output for 5.5.27
test1: -0.0021958351135254test2: -0.0025711059570312
Output for 5.5.26
test1: -0.0028829574584961test2: -0.0035068988800049
Output for 5.5.25
test1: -0.0026500225067139test2: -0.0031468868255615
Output for 5.5.24
test1: -0.0029909610748291test2: -0.0035860538482666
Output for 5.5.23
test1: -0.0032229423522949test2: -0.0037081241607666
Output for 5.5.22
test1: -0.0024621486663818test2: -0.0029611587524414
Output for 5.5.21
test1: -0.0023281574249268test2: -0.0027949810028076
Output for 5.5.20
test1: -0.0023229122161865test2: -0.0027198791503906
Output for 5.5.19
test1: -0.0027749538421631test2: -0.0033719539642334
Output for 5.5.18
test1: -0.0031189918518066test2: -0.0037319660186768
Output for 5.5.16
test1: -0.0028529167175293test2: -0.0029377937316895
Output for 5.5.15
test1: -0.002371072769165test2: -0.0028018951416016
Output for 5.5.14
test1: -0.0026900768280029test2: -0.0032861232757568
Output for 5.5.13
test1: -0.0030269622802734test2: -0.0038430690765381
Output for 5.5.12
test1: -0.0023539066314697test2: -0.0027639865875244
Output for 5.5.11
test1: -0.0023031234741211test2: -0.0027749538421631
Output for 5.5.10
test1: -0.0019659996032715test2: -0.0023901462554932
Output for 5.5.9
test1: -0.0048050880432129test2: -0.005047082901001
Output for 5.5.8
test1: -0.0031270980834961test2: -0.0037879943847656
Output for 5.5.7
test1: -0.0024449825286865test2: -0.0030279159545898
Output for 5.5.6
test1: -0.0028328895568848test2: -0.0031540393829346
Output for 5.5.5
test1: -0.0023941993713379test2: -0.0028982162475586
Output for 5.5.4
test1: -0.0018198490142822test2: -0.0022861957550049
Output for 5.5.3
test1: -0.001741886138916test2: -0.0021870136260986
Output for 5.5.2
test1: -0.0016789436340332test2: -0.0022101402282715
Output for 5.5.1
test1: -0.0020978450775146test2: -0.0024819374084473
Output for 5.5.0
test1: -0.0016729831695557test2: -0.0022239685058594
Output for 5.4.45
test1: -0.0026669502258301test2: -0.0035111904144287
Output for 5.4.44
test1: -0.0025410652160645test2: -0.0031800270080566
Output for 5.4.43
test1: -0.002957820892334test2: -0.0037498474121094
Output for 5.4.42
test1: -0.0021190643310547test2: -0.0027451515197754
Output for 5.4.41
test1: -0.0027940273284912test2: -0.0035440921783447
Output for 5.4.40
test1: -0.0042660236358643test2: -0.0041930675506592
Output for 5.4.39
test1: -0.0021419525146484test2: -0.0027430057525635
Output for 5.4.38
test1: -0.0018718242645264test2: -0.0021460056304932
Output for 5.4.37
test1: -0.0024080276489258test2: -0.0030350685119629
Output for 5.4.36
test1: -0.0020439624786377test2: -0.0026898384094238
Output for 5.4.35
test1: -0.0028769969940186test2: -0.0035340785980225
Output for 5.4.34
test1: -0.0027110576629639test2: -0.0032529830932617
Output for 5.4.32
test1: -0.0029339790344238test2: -0.0036048889160156
Output for 5.4.31
test1: -0.0023419857025146test2: -0.0028481483459473
Output for 5.4.30
test1: -0.0025291442871094test2: -0.0031149387359619
Output for 5.4.29
test1: -0.0030181407928467test2: -0.0038659572601318
Output for 5.4.28
test1: -0.0024459362030029test2: -0.0033540725708008
Output for 5.4.27
test1: -0.0021839141845703test2: -0.0028278827667236
Output for 5.4.26
test1: -0.0025248527526855test2: -0.00319504737854
Output for 5.4.25
test1: -0.0022010803222656test2: -0.0022671222686768
Output for 5.4.24
test1: -0.0020511150360107test2: -0.0024981498718262
Output for 5.4.23
test1: -0.0023250579833984test2: -0.0029780864715576
Output for 5.4.22
test1: -0.0025560855865479test2: -0.0032920837402344
Output for 5.4.21
test1: -0.0027210712432861test2: -0.0051159858703613
Output for 5.4.20
test1: -0.0016641616821289test2: -0.0021750926971436
Output for 5.4.19
test1: -0.00180983543396test2: -0.0021958351135254
Output for 5.4.18
test1: -0.002485990524292test2: -0.0029981136322021
Output for 5.4.17
test1: -0.0017879009246826test2: -0.0021669864654541
Output for 5.4.16
test1: -0.0016779899597168test2: -0.0022561550140381
Output for 5.4.15
test1: -0.0016989707946777test2: -0.0021419525146484
Output for 5.4.14
test1: -0.0015239715576172test2: -0.0018718242645264
Output for 5.4.13
test1: -0.0014050006866455test2: -0.0019559860229492
Output for 5.4.12
test1: -0.0016839504241943test2: -0.0021929740905762
Output for 5.4.11
test1: -0.0017189979553223test2: -0.0022468566894531
Output for 5.4.10
test1: -0.0017180442810059test2: -0.0021860599517822
Output for 5.4.9
test1: -0.0022139549255371test2: -0.0027639865875244
Output for 5.4.8
test1: -0.0014400482177734test2: -0.0017969608306885
Output for 5.4.7
test1: -0.0016810894012451test2: -0.0022399425506592
Output for 5.4.6
test1: -0.0017569065093994test2: -0.0024511814117432
Output for 5.4.5
test1: -0.0016729831695557test2: -0.0021259784698486
Output for 5.4.4
test1: -0.0017020702362061test2: -0.0021378993988037
Output for 5.4.3
test1: -0.001716136932373test2: -0.0021181106567383
Output for 5.4.2
test1: -0.001708984375test2: -0.00217604637146
Output for 5.4.1
test1: -0.0017647743225098test2: -0.0021109580993652
Output for 5.4.0
test1: -0.0018818378448486test2: -0.0022091865539551
Output for 5.3.29
test1: -0.0041799545288086test2: -0.0040290355682373
Output for 5.3.28
test1: -0.0040059089660645test2: -0.0039560794830322
Output for 5.3.27
test1: -0.0025150775909424test2: -0.0024621486663818
Output for 5.3.26
test1: -0.0026960372924805test2: -0.0027239322662354
Output for 5.3.25
test1: -0.0025670528411865test2: -0.002493143081665
Output for 5.3.24
test1: -0.0025479793548584test2: -0.0024631023406982
Output for 5.3.23
test1: -0.0026130676269531test2: -0.0024809837341309
Output for 5.3.22
test1: -0.0027680397033691test2: -0.002701997756958
Output for 5.3.21
test1: -0.002500057220459test2: -0.0027539730072021
Output for 5.3.20
test1: -0.0027968883514404test2: -0.0026869773864746
Output for 5.3.19
test1: -0.0040500164031982test2: -0.0043618679046631
Output for 5.3.18
test1: -0.0027620792388916test2: -0.002997875213623
Output for 5.3.17
test1: -0.0021481513977051test2: -0.002032995223999
Output for 5.3.16
test1: -0.002547025680542test2: -0.0025022029876709
Output for 5.3.15
test1: -0.0025410652160645test2: -0.002464771270752
Output for 5.3.14
test1: -0.0026340484619141test2: -0.0027859210968018
Output for 5.3.13
test1: -0.002892017364502test2: -0.002769947052002
Output for 5.3.12
test1: -0.0025990009307861test2: -0.0024800300598145
Output for 5.3.11
test1: -0.0032289028167725test2: -0.0025720596313477
Output for 5.3.10
test1: -0.0026531219482422test2: -0.0024840831756592
Output for 5.3.9
test1: -0.0025179386138916test2: -0.0025310516357422
Output for 5.3.8
test1: -0.0030999183654785test2: -0.0030059814453125
Output for 5.3.7
test1: -0.0028128623962402test2: -0.0026438236236572
Output for 5.3.6
test1: -0.0025300979614258test2: -0.0023918151855469
Output for 5.3.5
test1: -0.0022649765014648test2: -0.0020971298217773
Output for 5.3.4
test1: -0.0040860176086426test2: -0.0038750171661377
Output for 5.3.3
test1: -0.0036368370056152test2: -0.003281831741333
Output for 5.3.2
test1: -0.0024938583374023test2: -0.0024049282073975
Output for 5.3.1
test1: -0.0040431022644043test2: -0.0033538341522217
Output for 5.3.0
test1: -0.0030889511108398test2: -0.0028510093688965
Output for 5.2.17
test1: -0.0040919780731201test2: -0.0037472248077393
Output for 5.2.16
test1: -0.0034329891204834test2: -0.0031411647796631
Output for 5.2.15
test1: -0.0063629150390625test2: -0.0057220458984375
Output for 5.2.14
test1: -0.0039751529693604test2: -0.0035800933837891
Output for 5.2.13
test1: -0.0065131187438965test2: -0.0060989856719971
Output for 5.2.12
test1: -0.0050249099731445test2: -0.0047440528869629
Output for 5.2.11
test1: -0.0068149566650391test2: -0.006309986114502
Output for 5.2.10
test1: -0.0062129497528076test2: -0.0051438808441162
Output for 5.2.9
test1: -0.0064239501953125test2: -0.0046420097351074
Output for 5.2.8
test1: -0.0071718692779541test2: -0.0065951347351074
Output for 5.2.7
test1: -0.0059220790863037test2: -0.0054900646209717
Output for 5.2.6
test1: -0.0056388378143311test2: -0.0056049823760986
Output for 5.2.5
test1: -0.0062589645385742test2: -0.0059559345245361
Output for 5.2.4
test1: -0.0065419673919678test2: -0.0058281421661377
Output for 5.2.3
test1: -0.0075240135192871test2: -0.0067679882049561
Output for 5.2.2
test1: -0.005950927734375test2: -0.005702018737793
Output for 5.2.1
test1: -0.0067729949951172test2: -0.0061171054840088
Output for 5.2.0
test1: -0.0054340362548828test2: -0.0051288604736328
Output for 5.1.6
test1: -0.0070209503173828test2: -0.0065288543701172
Output for 5.1.5
test1: -0.0083420276641846test2: -0.0076961517333984
Output for 5.1.4
test1: -0.0087289810180664test2: -0.0078220367431641
Output for 5.1.3
test1: -0.0077419281005859test2: -0.0071370601654053
Output for 5.1.2
test1: -0.0069830417633057test2: -0.0066368579864502
Output for 5.1.1
test1: -0.0088231563568115test2: -0.0081660747528076
Output for 5.1.0
test1: -0.0074818134307861test2: -0.0067269802093506
Output for 5.0.5
test1: -0.011487007141113test2: -0.010116100311279
Output for 5.0.4
test1: -0.016656875610352test2: -0.011892080307007
Output for 5.0.3
test1: -0.0090210437774658test2: -0.0087227821350098
Output for 5.0.2
test1: -0.011142015457153test2: -0.0097990036010742
Output for 5.0.1
test1: -0.0082449913024902test2: -0.0067849159240723
Output for 5.0.0
test1: -0.0119469165802test2: -0.0097949504852295
Output for 4.4.9
test1: -0.011999test2: -0.010475
Output for 4.4.8
test1: -0.011079test2: -0.009403
Output for 4.4.7
test1: -0.011845test2: -0.010984
Output for 4.4.6
test1: -0.012011test2: -0.010423
Output for 4.4.5
test1: -0.011223test2: -0.009814
Output for 4.4.4
test1: -0.008224test2: -0.007715
Output for 4.4.3
test1: -0.011622test2: -0.010161
Output for 4.4.2
test1: -0.01181test2: -0.012184
Output for 4.4.1
test1: -0.012005test2: -0.010258
Output for 4.4.0
test1: -0.013444test2: -0.013167
Output for 4.3.11
test1: -0.009368test2: -0.00753
Output for 4.3.10
test1: -0.009377test2: -0.008116
Output for 4.3.9
test1: -0.011786test2: -0.010173
Output for 4.3.8
test1: -0.011923test2: -0.008979
Output for 4.3.7
test1: -0.012335test2: -0.009523
Output for 4.3.6
test1: -0.00924test2: -0.009066
Output for 4.3.5
test1: -0.012474test2: -0.010619
Output for 4.3.4
test1: -0.010867test2: -0.008301
Output for 4.3.3
test1: -0.012018test2: -0.011586
Output for 4.3.2
test1: -0.011849test2: -0.009735
Output for 4.3.1
test1: -0.008107test2: -0.008117
Output for 4.3.0
test1: -0.012776test2: -0.010616