3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class test { function switch100($case) { switch ($case) { case 0: break; case 1: break; case 2: break; case 3: break; case 4: break; case 5: break; case 6: break; case 7: break; case 8: break; case 9: break; case 10: break; case 11: break; case 12: break; case 13: break; case 14: break; case 15: break; case 16: break; case 17: break; case 18: break; case 19: break; case 20: break; case 21: break; case 22: break; case 23: break; case 24: break; case 25: break; case 26: break; case 27: break; case 28: break; case 29: break; case 30: break; case 31: break; case 32: break; case 33: break; case 34: break; case 35: break; case 36: break; case 37: break; case 38: break; case 39: break; case 40: break; case 41: break; case 42: break; case 43: break; case 44: break; case 45: break; case 46: break; case 47: break; case 48: break; case 49: break; case 50: break; case 51: break; case 52: break; case 53: break; case 54: break; case 55: break; case 56: break; case 57: break; case 58: break; case 59: break; case 60: break; case 61: break; case 62: break; case 63: break; case 64: break; case 65: break; case 66: break; case 67: break; case 68: break; case 69: break; case 70: break; case 71: break; case 72: break; case 73: break; case 74: break; case 75: break; case 76: break; case 77: break; case 78: break; case 79: break; case 80: break; case 81: break; case 82: break; case 83: break; case 84: break; case 85: break; case 86: break; case 87: break; case 88: break; case 89: break; case 90: break; case 91: break; case 92: break; case 93: break; case 94: break; case 95: break; case 96: break; case 97: break; case 98: break; case 99: break; } return $case; } } class testMethod { public function method($case) { $this->{'go' . $case}(); } public function go0() { } public function go1() { } public function go2() { } public function go3() { } public function go4() { } public function go5() { } public function go6() { } public function go7() { } public function go8() { } public function go9() { } public function go10() { } public function go11() { } public function go12() { } public function go13() { } public function go14() { } public function go15() { } public function go16() { } public function go17() { } public function go18() { } public function go19() { } public function go20() { } public function go21() { } public function go22() { } public function go23() { } public function go24() { } public function go25() { } public function go26() { } public function go27() { } public function go28() { } public function go29() { } public function go30() { } public function go31() { } public function go32() { } public function go33() { } public function go34() { } public function go35() { } public function go36() { } public function go37() { } public function go38() { } public function go39() { } public function go40() { } public function go41() { } public function go42() { } public function go43() { } public function go44() { } public function go45() { } public function go46() { } public function go47() { } public function go48() { } public function go49() { } public function go50() { } public function go51() { } public function go52() { } public function go53() { } public function go54() { } public function go55() { } public function go56() { } public function go57() { } public function go58() { } public function go59() { } public function go60() { } public function go61() { } public function go62() { } public function go63() { } public function go64() { } public function go65() { } public function go66() { } public function go67() { } public function go68() { } public function go69() { } public function go70() { } public function go71() { } public function go72() { } public function go73() { } public function go74() { } public function go75() { } public function go76() { } public function go77() { } public function go78() { } public function go79() { } public function go80() { } public function go81() { } public function go82() { } public function go83() { } public function go84() { } public function go85() { } public function go86() { } public function go87() { } public function go88() { } public function go89() { } public function go90() { } public function go91() { } public function go92() { } public function go93() { } public function go94() { } public function go95() { } public function go96() { } public function go97() { } public function go98() { } public function go99() { } } $start = microtime(true); $count = 100000; $instance = new test(); $instance2 = new testMethod(); for ($i = 0; $i <= $count; $i++) { $instance->switch100($i % 100); } var_dump(microtime(true) - $start); $start = microtime(true); for ($i = 0; $i <= $count; $i++) { $instance2->method($i % 100); } var_dump(microtime(true) - $start);
Output for 7.1.0
float(0.037289142608643) float(0.018024206161499)
Output for 7.0.14
float(0.036121129989624) float(0.020813941955566)
Output for 7.0.10
float(0.026587963104248) float(0.014127016067505)
Output for 7.0.9
float(0.02882194519043) float(0.018359184265137)
Output for 7.0.8
float(0.028522968292236) float(0.016231060028076)
Output for 7.0.7
float(0.030182123184204) float(0.019239902496338)
Output for 7.0.6
float(0.029752016067505) float(0.019016027450562)
Output for 7.0.5
float(0.028666973114014) float(0.01742696762085)
Output for 7.0.4
float(0.029206991195679) float(0.016956090927124)
Output for 7.0.3
float(0.034075975418091) float(0.021291017532349)
Output for 7.0.2
float(0.030436038970947) float(0.017996072769165)
Output for 7.0.1
float(0.022552967071533) float(0.014772891998291)
Output for 7.0.0
float(0.028815984725952) float(0.018568992614746)
Output for 5.6.28
float(0.11325907707214) float(0.027849197387695)
Output for 5.6.25
float(0.094870090484619) float(0.032241106033325)
Output for 5.6.24
float(0.085610866546631) float(0.037561893463135)
Output for 5.6.23
float(0.093441009521484) float(0.032333135604858)
Output for 5.6.22
float(0.11183190345764) float(0.035658836364746)
Output for 5.6.21
float(0.077585935592651) float(0.031773090362549)
Output for 5.6.20
float(0.077673196792603) float(0.032340049743652)
Output for 5.6.19
float(0.098598957061768) float(0.035830974578857)
Output for 5.6.18
float(0.093503952026367) float(0.033038854598999)
Output for 5.6.17
float(0.09223198890686) float(0.040064096450806)
Output for 5.6.16
float(0.083033084869385) float(0.033046960830688)
Output for 5.6.15
float(0.094452857971191) float(0.032295942306519)
Output for 5.6.14
float(0.086701154708862) float(0.032947778701782)
Output for 5.6.13
float(0.082546949386597) float(0.037123918533325)
Output for 5.6.12
float(0.091114044189453) float(0.032527923583984)
Output for 5.6.11
float(0.085912942886353) float(0.036977052688599)
Output for 5.6.10
float(0.094308137893677) float(0.03741979598999)
Output for 5.6.9
float(0.086605072021484) float(0.03516411781311)
Output for 5.6.8
float(0.092507123947144) float(0.034137964248657)
Output for 5.6.7
float(0.089298963546753) float(0.032001972198486)
Output for 5.6.6
float(0.10239291191101) float(0.036355972290039)
Output for 5.6.5
float(0.091970920562744) float(0.033286094665527)
Output for 5.6.4
float(0.098705053329468) float(0.035392999649048)
Output for 5.6.3
float(0.090209007263184) float(0.032048940658569)
Output for 5.6.2
float(0.088013172149658) float(0.032212018966675)
Output for 5.6.1
float(0.094429969787598) float(0.032660961151123)
Output for 5.6.0
float(0.1036319732666) float(0.03717303276062)
Output for 5.5.38
float(0.090740919113159) float(0.032155990600586)
Output for 5.5.37
float(0.099003076553345) float(0.032502174377441)
Output for 5.5.36
float(0.0956711769104) float(0.037523031234741)
Output for 5.5.35
float(0.088510990142822) float(0.032750844955444)
Output for 5.5.34
float(0.10554385185242) float(0.034988880157471)
Output for 5.5.33
float(0.08759593963623) float(0.036151170730591)
Output for 5.5.32
float(0.089107036590576) float(0.038367986679077)
Output for 5.5.31
float(0.095524072647095) float(0.032251119613647)
Output for 5.5.30
float(0.085787057876587) float(0.036237955093384)
Output for 5.5.29
float(0.086284875869751) float(0.032503128051758)
Output for 5.5.28
float(0.11757516860962) float(0.034763097763062)
Output for 5.5.27
float(0.080261945724487) float(0.032106876373291)
Output for 5.5.26
float(0.077369928359985) float(0.032552003860474)
Output for 5.5.25
float(0.081120014190674) float(0.032740831375122)
Output for 5.5.24
float(0.082027196884155) float(0.03187084197998)
Output for 5.5.23
float(0.082480907440186) float(0.032665967941284)
Output for 5.5.22
float(0.08557391166687) float(0.03787088394165)
Output for 5.5.21
float(0.083225965499878) float(0.036806106567383)
Output for 5.5.20
float(0.089012145996094) float(0.032621145248413)
Output for 5.5.19
float(0.085180997848511) float(0.032508134841919)
Output for 5.5.18
float(0.095450162887573) float(0.039178848266602)
Output for 5.5.16
float(0.1029839515686) float(0.037018060684204)
Output for 5.5.15
float(0.09055495262146) float(0.032724142074585)
Output for 5.5.14
float(0.085355043411255) float(0.031424999237061)
Output for 5.5.13
float(0.090373992919922) float(0.03252100944519)
Output for 5.5.12
float(0.082056999206543) float(0.031637191772461)
Output for 5.5.11
float(0.10369801521301) float(0.036665916442871)
Output for 5.5.10
float(0.10263919830322) float(0.036197900772095)
Output for 5.5.9
float(0.088529825210571) float(0.035897970199585)
Output for 5.5.8
float(0.10259795188904) float(0.036111831665039)
Output for 5.5.7
float(0.091299057006836) float(0.032544136047363)
Output for 5.5.6
float(0.086245059967041) float(0.036470890045166)
Output for 5.5.5
float(0.085222005844116) float(0.031848907470703)
Output for 5.5.4
float(0.088500022888184) float(0.032130002975464)
Output for 5.5.3
float(0.087915182113647) float(0.032649993896484)
Output for 5.5.2
float(0.094709873199463) float(0.032459020614624)
Output for 5.5.1
float(0.083794116973877) float(0.033807992935181)
Output for 5.5.0
float(0.10432314872742) float(0.036304950714111)
Output for 5.4.45
float(0.08948802947998) float(0.032835006713867)
Output for 5.4.44
float(0.088992834091187) float(0.031970024108887)
Output for 5.4.43
float(0.088244199752808) float(0.032176971435547)
Output for 5.4.42
float(0.097934007644653) float(0.036135196685791)
Output for 5.4.41
float(0.072839975357056) float(0.032160997390747)
Output for 5.4.40
float(0.093007802963257) float(0.036834001541138)
Output for 5.4.39
float(0.083175897598267) float(0.037766933441162)
Output for 5.4.38
float(0.095530033111572) float(0.031805992126465)
Output for 5.4.37
float(0.095056056976318) float(0.03577184677124)
Output for 5.4.36
float(0.098860025405884) float(0.037229061126709)
Output for 5.4.35
float(0.09601092338562) float(0.036329030990601)
Output for 5.4.34
float(0.085613012313843) float(0.036418914794922)
Output for 5.4.32
float(0.099207162857056) float(0.037064790725708)
Output for 5.4.31
float(0.094794988632202) float(0.032236814498901)
Output for 5.4.30
float(0.097206115722656) float(0.035854816436768)
Output for 5.4.29
float(0.092555999755859) float(0.031769990921021)
Output for 5.4.28
float(0.08955192565918) float(0.033942937850952)
Output for 5.4.27
float(0.086115121841431) float(0.032580852508545)
Output for 5.4.26
float(0.10102200508118) float(0.037570953369141)
Output for 5.4.25
float(0.094770908355713) float(0.03272008895874)
Output for 5.4.24
float(0.097508907318115) float(0.034608125686646)
Output for 5.4.23
float(0.1007969379425) float(0.038203001022339)
Output for 5.4.22
float(0.081918001174927) float(0.031851053237915)
Output for 5.4.21
float(0.082001924514771) float(0.031357049942017)
Output for 5.4.20
float(0.088399887084961) float(0.032973051071167)
Output for 5.4.19
float(0.091177940368652) float(0.034042119979858)
Output for 5.4.18
float(0.07377290725708) float(0.031569004058838)
Output for 5.4.17
float(0.091504096984863) float(0.037363052368164)
Output for 5.4.16
float(0.077140092849731) float(0.032076835632324)
Output for 5.4.15
float(0.090595006942749) float(0.034353017807007)
Output for 5.4.14
float(0.10042214393616) float(0.036919832229614)
Output for 5.4.13
float(0.089017152786255) float(0.032588005065918)
Output for 5.4.12
float(0.076315879821777) float(0.031744956970215)
Output for 5.4.11
float(0.079780101776123) float(0.031249046325684)
Output for 5.4.10
float(0.087553977966309) float(0.036667108535767)
Output for 5.4.9
float(0.082966804504395) float(0.031477928161621)
Output for 5.4.8
float(0.092123031616211) float(0.034565925598145)
Output for 5.4.7
float(0.098193168640137) float(0.036517143249512)
Output for 5.4.6
float(0.079807996749878) float(0.038971185684204)
Output for 5.4.5
float(0.084179878234863) float(0.031513929367065)
Output for 5.4.4
float(0.067375898361206) float(0.030930995941162)
Output for 5.4.3
float(0.069808006286621) float(0.031476020812988)
Output for 5.4.2
float(0.069743871688843) float(0.031208038330078)
Output for 5.4.1
float(0.082553863525391) float(0.031872034072876)
Output for 5.4.0
float(0.067722797393799) float(0.027503967285156)
Output for 5.3.29
float(0.12427306175232) float(0.048271179199219)
Output for 5.3.28
float(0.10656213760376) float(0.044467926025391)
Output for 5.3.27
float(0.088397026062012) float(0.042176008224487)
Output for 5.3.26
float(0.10375905036926) float(0.042972087860107)
Output for 5.3.25
float(0.094310998916626) float(0.04169487953186)
Output for 5.3.24
float(0.091439008712769) float(0.042527914047241)
Output for 5.3.23
float(0.099647045135498) float(0.04240894317627)
Output for 5.3.22
float(0.10806202888489) float(0.043889045715332)
Output for 5.3.21
float(0.10178399085999) float(0.042252063751221)
Output for 5.3.20
float(0.086730003356934) float(0.041223049163818)
Output for 5.3.19
float(0.10121703147888) float(0.042611122131348)
Output for 5.3.18
float(0.12017917633057) float(0.048810005187988)
Output for 5.3.17
float(0.098998069763184) float(0.041601896286011)
Output for 5.3.16
float(0.099448919296265) float(0.043915033340454)
Output for 5.3.15
float(0.094285011291504) float(0.048192024230957)
Output for 5.3.14
float(0.092227935791016) float(0.041440010070801)
Output for 5.3.13
float(0.082170009613037) float(0.041715145111084)
Output for 5.3.12
float(0.095111131668091) float(0.042214870452881)
Output for 5.3.11
float(0.078655958175659) float(0.040734052658081)
Output for 5.3.10
float(0.077544927597046) float(0.039721965789795)
Output for 5.3.9
float(0.11164593696594) float(0.046161890029907)
Output for 5.3.8
float(0.11408281326294) float(0.042983055114746)
Output for 5.3.7
float(0.11145114898682) float(0.042169094085693)
Output for 5.3.6
float(0.080511093139648) float(0.042156934738159)
Output for 5.3.5
float(0.095437049865723) float(0.042411088943481)
Output for 5.3.4
float(0.084466218948364) float(0.041690826416016)
Output for 5.3.3
float(0.081782102584839) float(0.042073011398315)
Output for 5.3.2
float(0.080621957778931) float(0.043606996536255)
Output for 5.3.1
float(0.07961893081665) float(0.042937994003296)
Output for 5.3.0
float(0.090359926223755) float(0.046443939208984)