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\n\n"; if ($start1 < $start2) { $perc = round(($start1 / $start2) * 100,2)-100; echo "Test1 is $perc"."% faster than Test2"; } if ($start2 < $start2) { $perc = round(($start2 / $start1) * 100,2)-100; echo "Test2 is $perc"."% faster than Test1"; }
Output for 7.1.0
test1: -0.00064802169799805 test2: -0.00047421455383301 Test1 is 36.65% faster than Test2
Output for 7.0.14
test1: -0.001305103302002 test2: -0.00089907646179199 Test1 is 45.16% faster than Test2
Output for 7.0.12
test1: -0.0012600421905518 test2: -0.00092291831970215 Test1 is 36.53% faster than Test2
Output for 7.0.6
test1: -0.00074315071105957 test2: -0.00058102607727051 Test1 is 27.9% faster than Test2
Output for 7.0.5
test1: -0.00050997734069824 test2: -0.00038290023803711 Test1 is 33.19% faster than Test2
Output for 7.0.4
test1: -0.00069403648376465 test2: -0.00055384635925293 Test1 is 25.31% faster than Test2
Output for 7.0.3
test1: -0.00050687789916992 test2: -0.00039196014404297 Test1 is 29.32% faster than Test2
Output for 7.0.2
test1: -0.00067496299743652 test2: -0.00051689147949219 Test1 is 30.58% faster than Test2
Output for 7.0.1
test1: -0.00051307678222656 test2: -0.00049114227294922 Test1 is 4.47% faster than Test2
Output for 7.0.0
test1: -0.00070905685424805 test2: -0.00055408477783203 Test1 is 27.97% faster than Test2
Output for hhvm-3.12.0
test1: -0.0018429756164551 test2: -0.0019018650054932
Output for hhvm-3.10.0

Process exited with code 153.
Output for 5.6.28
test1: -0.0035099983215332 test2: -0.0033841133117676 Test1 is 3.72% faster than Test2
Output for 5.6.21
test1: -0.0029299259185791 test2: -0.0028951168060303 Test1 is 1.2% faster than Test2
Output for 5.6.20
test1: -0.0021378993988037 test2: -0.0023400783538818
Output for 5.6.19
test1: -0.0034918785095215 test2: -0.0024950504302979 Test1 is 39.95% faster than Test2
Output for 5.6.18
test1: -0.0017812252044678 test2: -0.0015738010406494 Test1 is 13.18% faster than Test2
Output for 5.6.17
test1: -0.0018448829650879 test2: -0.0021839141845703
Output for 5.6.16
test1: -0.0029139518737793 test2: -0.0035660266876221
Output for 5.6.15
test1: -0.0023899078369141 test2: -0.0032100677490234
Output for 5.6.14
test1: -0.0026600360870361 test2: -0.0030171871185303
Output for 5.6.13
test1: -0.0027809143066406 test2: -0.0031659603118896
Output for 5.6.12
test1: -0.0022909641265869 test2: -0.0027759075164795
Output for 5.6.11
test1: -0.0018341541290283 test2: -0.0021860599517822
Output for 5.6.10
test1: -0.0027618408203125 test2: -0.0033078193664551
Output for 5.6.9
test1: -0.0028150081634521 test2: -0.0032780170440674
Output for 5.6.8
test1: -0.0026748180389404 test2: -0.0031960010528564
Output for 5.6.7
test1: -0.0020110607147217 test2: -0.0023431777954102
Output for 5.5.35
test1: -0.0023319721221924 test2: -0.002885103225708
Output for 5.5.34
test1: -0.0026609897613525 test2: -0.0031681060791016
Output for 5.5.33
test1: -0.0027530193328857 test2: -0.0024468898773193 Test1 is 12.51% faster than Test2
Output for 5.5.32
test1: -0.0016930103302002 test2: -0.0020730495452881
Output for 5.5.31
test1: -0.0025429725646973 test2: -0.0030739307403564
Output for 5.5.30
test1: -0.0021650791168213 test2: -0.0026490688323975
Output for 5.5.29
test1: -0.0023589134216309 test2: -0.0028600692749023
Output for 5.5.28
test1: -0.0029609203338623 test2: -0.0035429000854492
Output for 5.5.27
test1: -0.0019941329956055 test2: -0.002392053604126
Output for 5.5.26
test1: -0.0027060508728027 test2: -0.0032408237457275
Output for 5.5.25
test1: -0.0027670860290527 test2: -0.0029659271240234
Output for 5.5.24
test1: -0.0028331279754639 test2: -0.0031218528747559
Output for 5.4.45
test1: -0.0017480850219727 test2: -0.0016329288482666 Test1 is 7.05% faster than Test2
Output for 5.4.44
test1: -0.001737117767334 test2: -0.0016579627990723 Test1 is 4.77% faster than Test2
Output for 5.4.43
test1: -0.0018179416656494 test2: -0.001600980758667 Test1 is 13.55% faster than Test2
Output for 5.4.42
test1: -0.0026710033416748 test2: -0.0025770664215088 Test1 is 3.65% faster than Test2
Output for 5.4.41
test1: -0.0026068687438965 test2: -0.0023460388183594 Test1 is 11.12% faster than Test2
Output for 5.4.40
test1: -0.0017077922821045 test2: -0.0016388893127441 Test1 is 4.2% faster than Test2
Output for 5.4.39
test1: -0.0023648738861084 test2: -0.0019960403442383 Test1 is 18.48% faster than Test2
Output for 5.4.38
test1: -0.0026929378509521 test2: -0.0026071071624756 Test1 is 3.29% faster than Test2
Output for 5.4.37
test1: -0.0025429725646973 test2: -0.0025539398193359
Output for 5.4.36
test1: -0.0025370121002197 test2: -0.0023910999298096 Test1 is 6.1% faster than Test2
Output for 5.4.35
test1: -0.0028030872344971 test2: -0.0026559829711914 Test1 is 5.54% faster than Test2
Output for 5.4.34
test1: -0.0028209686279297 test2: -0.0025949478149414 Test1 is 8.71% faster than Test2
Output for 5.4.32
test1: -0.0025730133056641 test2: -0.0023739337921143 Test1 is 8.39% faster than Test2
Output for 5.4.31
test1: -0.0051090717315674 test2: -0.00376296043396 Test1 is 35.77% faster than Test2
Output for 5.4.30
test1: -0.0020217895507812 test2: -0.0019199848175049 Test1 is 5.3% faster than Test2
Output for 5.4.29
test1: -0.002899169921875 test2: -0.0026750564575195 Test1 is 8.38% faster than Test2
Output for 5.4.28
test1: -0.0027639865875244 test2: -0.0026350021362305 Test1 is 4.9% faster than Test2
Output for 5.4.27
test1: -0.0025968551635742 test2: -0.0025210380554199 Test1 is 3.01% faster than Test2
Output for 5.4.26
test1: -0.002640962600708 test2: -0.002485990524292 Test1 is 6.23% faster than Test2
Output for 5.4.25
test1: -0.002061128616333 test2: -0.0019659996032715 Test1 is 4.84% faster than Test2
Output for 5.4.24
test1: -0.0025448799133301 test2: -0.0025119781494141 Test1 is 1.31% faster than Test2
Output for 5.4.23
test1: -0.0027909278869629 test2: -0.0025999546051025 Test1 is 7.35% faster than Test2
Output for 5.4.22
test1: -0.0024490356445312 test2: -0.0025420188903809
Output for 5.4.21
test1: -0.0018110275268555 test2: -0.0019121170043945
Output for 5.4.20
test1: -0.0018651485443115 test2: -0.0017809867858887 Test1 is 4.73% faster than Test2
Output for 5.4.19
test1: -0.0027480125427246 test2: -0.0023829936981201 Test1 is 15.32% faster than Test2
Output for 5.4.18
test1: -0.0018310546875 test2: -0.0016472339630127 Test1 is 11.16% faster than Test2
Output for 5.4.17
test1: -0.0018868446350098 test2: -0.0016770362854004 Test1 is 12.51% faster than Test2
Output for 5.4.16
test1: -0.0042111873626709 test2: -0.0029439926147461 Test1 is 43.04% faster than Test2
Output for 5.4.15
test1: -0.0026638507843018 test2: -0.0024750232696533 Test1 is 7.63% faster than Test2
Output for 5.4.14
test1: -0.0016770362854004 test2: -0.0016179084777832 Test1 is 3.65% faster than Test2
Output for 5.4.13
test1: -0.0016779899597168 test2: -0.00160813331604 Test1 is 4.34% faster than Test2
Output for 5.4.12
test1: -0.0026600360870361 test2: -0.0024099349975586 Test1 is 10.38% faster than Test2
Output for 5.4.11
test1: -0.0016951560974121 test2: -0.001594066619873 Test1 is 6.34% faster than Test2
Output for 5.4.10
test1: -0.002795934677124 test2: -0.0027840137481689 Test1 is 0.43000000000001% faster than Test2
Output for 5.4.9
test1: -0.0025050640106201 test2: -0.0023808479309082 Test1 is 5.22% faster than Test2
Output for 5.4.8
test1: -0.0018010139465332 test2: -0.0017850399017334 Test1 is 0.89% faster than Test2
Output for 5.4.7
test1: -0.0019228458404541 test2: -0.0017478466033936 Test1 is 10.01% faster than Test2
Output for 5.4.6
test1: -0.0026319026947021 test2: -0.0025391578674316 Test1 is 3.65% faster than Test2
Output for 5.4.5
test1: -0.0026481151580811 test2: -0.0025479793548584 Test1 is 3.93% faster than Test2
Output for 5.4.4
test1: -0.0027549266815186 test2: -0.0023097991943359 Test1 is 19.27% faster than Test2
Output for 5.4.3
test1: -0.0026059150695801 test2: -0.0024268627166748 Test1 is 7.38% faster than Test2
Output for 5.4.2
test1: -0.0025501251220703 test2: -0.0023939609527588 Test1 is 6.52% faster than Test2
Output for 5.4.1
test1: -0.0027918815612793 test2: -0.0025589466094971 Test1 is 9.1% faster than Test2
Output for 5.4.0
test1: -0.0018219947814941 test2: -0.0016810894012451 Test1 is 8.38% faster than Test2
Output for 5.3.29
test1: -0.0031089782714844 test2: -0.0030460357666016 Test1 is 2.07% faster than Test2
Output for 5.3.28
test1: -0.0035622119903564 test2: -0.0032241344451904 Test1 is 10.49% faster than Test2
Output for 5.3.27
test1: -0.0025749206542969 test2: -0.0024559497833252 Test1 is 4.84% faster than Test2
Output for 5.3.26
test1: -0.0022401809692383 test2: -0.002129077911377 Test1 is 5.22% faster than Test2
Output for 5.3.25
test1: -0.0030281543731689 test2: -0.0024981498718262 Test1 is 21.22% faster than Test2
Output for 5.3.24
test1: -0.0029449462890625 test2: -0.0028049945831299 Test1 is 4.99% faster than Test2
Output for 5.3.23
test1: -0.0032339096069336 test2: -0.0032260417938232 Test1 is 0.23999999999999% faster than Test2
Output for 5.3.22
test1: -0.0024111270904541 test2: -0.0020899772644043 Test1 is 15.37% faster than Test2
Output for 5.3.21
test1: -0.0020508766174316 test2: -0.0019769668579102 Test1 is 3.74% faster than Test2
Output for 5.3.20
test1: -0.0029129981994629 test2: -0.0027370452880859 Test1 is 6.43% faster than Test2
Output for 5.3.19
test1: -0.0026030540466309 test2: -0.0023651123046875 Test1 is 10.06% faster than Test2
Output for 5.3.18
test1: -0.0025730133056641 test2: -0.0025050640106201 Test1 is 2.71% faster than Test2
Output for 5.3.17
test1: -0.0023660659790039 test2: -0.0022420883178711 Test1 is 5.53% faster than Test2
Output for 5.3.16
test1: -0.0030579566955566 test2: -0.0028500556945801 Test1 is 7.29% faster than Test2
Output for 5.3.15
test1: -0.0034570693969727 test2: -0.0032651424407959 Test1 is 5.88% faster than Test2
Output for 5.3.14
test1: -0.0034999847412109 test2: -0.0030620098114014 Test1 is 14.3% faster than Test2
Output for 5.3.13
test1: -0.0030519962310791 test2: -0.002769947052002 Test1 is 10.18% faster than Test2
Output for 5.3.12
test1: -0.003464937210083 test2: -0.0032100677490234 Test1 is 7.94% faster than Test2
Output for 5.3.11
test1: -0.0032899379730225 test2: -0.0030479431152344 Test1 is 7.94% faster than Test2
Output for 5.3.10
test1: -0.0025889873504639 test2: -0.002324104309082 Test1 is 11.4% faster than Test2
Output for 5.3.9
test1: -0.0019948482513428 test2: -0.0020899772644043
Output for 5.3.8
test1: -0.0029301643371582 test2: -0.0026988983154297 Test1 is 8.57% faster than Test2
Output for 5.3.7
test1: -0.0024700164794922 test2: -0.0024449825286865 Test1 is 1.02% faster than Test2
Output for 5.3.6
test1: -0.0020489692687988 test2: -0.0019040107727051 Test1 is 7.61% faster than Test2
Output for 5.3.5
test1: -0.0025310516357422 test2: -0.002363920211792 Test1 is 7.07% faster than Test2
Output for 5.3.4
test1: -0.0033190250396729 test2: -0.0030210018157959 Test1 is 9.87% faster than Test2
Output for 5.3.3
test1: -0.0033619403839111 test2: -0.0030419826507568 Test1 is 10.52% faster than Test2
Output for 5.3.2
test1: -0.0028359889984131 test2: -0.0025219917297363 Test1 is 12.45% faster than Test2
Output for 5.3.1
test1: -0.0020968914031982 test2: -0.0020661354064941 Test1 is 1.49% faster than Test2
Output for 5.3.0
test1: -0.0032980442047119 test2: -0.003000020980835 Test1 is 9.93% faster than Test2
Output for 5.2.17
test1: -0.0033748149871826 test2: -0.0028469562530518 Test1 is 18.54% faster than Test2
Output for 5.2.16
test1: -0.0052261352539062 test2: -0.0045759677886963 Test1 is 14.21% faster than Test2
Output for 5.2.15
test1: -0.0045158863067627 test2: -0.0040090084075928 Test1 is 12.64% faster than Test2
Output for 5.2.14
test1: -0.0046188831329346 test2: -0.0043070316314697 Test1 is 7.24% faster than Test2
Output for 5.2.13
test1: -0.0057311058044434 test2: -0.005234956741333 Test1 is 9.48% faster than Test2
Output for 5.2.12
test1: -0.0043570995330811 test2: -0.0034809112548828 Test1 is 25.17% faster than Test2
Output for 5.2.11
test1: -0.0046398639678955 test2: -0.0040428638458252 Test1 is 14.77% faster than Test2
Output for 5.2.10
test1: -0.0054888725280762 test2: -0.0047440528869629 Test1 is 15.7% faster than Test2
Output for 5.2.9
test1: -0.0051071643829346 test2: -0.0046160221099854 Test1 is 10.64% faster than Test2
Output for 5.2.8
test1: -0.0054471492767334 test2: -0.004796028137207 Test1 is 13.58% faster than Test2
Output for 5.2.7
test1: -0.0058650970458984 test2: -0.0045402050018311 Test1 is 29.18% faster than Test2
Output for 5.2.6
test1: -0.0055699348449707 test2: -0.0047011375427246 Test1 is 18.48% faster than Test2
Output for 5.2.5
test1: -0.005640983581543 test2: -0.0047848224639893 Test1 is 17.89% faster than Test2
Output for 5.2.4
test1: -0.0043191909790039 test2: -0.0038521289825439 Test1 is 12.12% faster than Test2
Output for 5.2.3
test1: -0.004796028137207 test2: -0.0041840076446533 Test1 is 14.63% faster than Test2
Output for 5.2.2
test1: -0.0060420036315918 test2: -0.0047600269317627 Test1 is 26.93% faster than Test2
Output for 5.2.1
test1: -0.0051720142364502 test2: -0.0044620037078857 Test1 is 15.91% faster than Test2
Output for 5.2.0
test1: -0.0057179927825928 test2: -0.0050590038299561 Test1 is 13.03% faster than Test2
Output for 5.1.6
test1: -0.0065639019012451 test2: -0.0053670406341553 Test1 is 22.3% faster than Test2
Output for 5.1.5
test1: -0.0056710243225098 test2: -0.0051851272583008 Test1 is 9.37% faster than Test2
Output for 5.1.4
test1: -0.0071530342102051 test2: -0.0068058967590332 Test1 is 5.1% faster than Test2
Output for 5.1.3
test1: -0.0053181648254395 test2: -0.004709005355835 Test1 is 12.94% faster than Test2
Output for 5.1.2
test1: -0.0057899951934814 test2: -0.0048940181732178 Test1 is 18.31% faster than Test2
Output for 5.1.1
test1: -0.0059490203857422 test2: -0.0053560733795166 Test1 is 11.07% faster than Test2
Output for 5.1.0
test1: -0.0042579174041748 test2: -0.003756046295166 Test1 is 13.36% faster than Test2
Output for 5.0.5
test1: -0.0067601203918457 test2: -0.005964994430542 Test1 is 13.33% faster than Test2
Output for 5.0.4
test1: -0.0053260326385498 test2: -0.0064589977264404
Output for 5.0.3
test1: -0.0089190006256104 test2: -0.010042905807495
Output for 5.0.2
test1: -0.009896993637085 test2: -0.0085179805755615 Test1 is 16.19% faster than Test2
Output for 5.0.1
test1: -0.0095939636230469 test2: -0.00838303565979 Test1 is 14.44% faster than Test2
Output for 5.0.0
test1: -0.0092740058898926 test2: -0.0087220668792725 Test1 is 6.33% faster than Test2
Output for 4.4.9
test1: -0.010001 test2: -0.009002 Test1 is 11.1% faster than Test2
Output for 4.4.8
test1: -0.008598 test2: -0.0077010000000001 Test1 is 11.65% faster than Test2
Output for 4.4.7
test1: -0.00684 test2: -0.006044 Test1 is 13.17% faster than Test2
Output for 4.4.6
test1: -0.010245 test2: -0.0088750000000001 Test1 is 15.44% faster than Test2
Output for 4.4.5
test1: -0.010383 test2: -0.0087739999999999 Test1 is 18.34% faster than Test2
Output for 4.4.4
test1: -0.0083299999999999 test2: -0.0072 Test1 is 15.69% faster than Test2
Output for 4.4.3
test1: -0.005516 test2: -0.0048210000000001 Test1 is 14.42% faster than Test2
Output for 4.4.2
test1: -0.005176 test2: -0.004643 Test1 is 11.48% faster than Test2
Output for 4.4.1
test1: -0.00663 test2: -0.005752 Test1 is 15.26% faster than Test2
Output for 4.4.0
test1: -0.007224 test2: -0.00636 Test1 is 13.58% faster than Test2
Output for 4.3.11
test1: -0.010126 test2: -0.009058 Test1 is 11.79% faster than Test2
Output for 4.3.10
test1: -0.0087700000000001 test2: -0.007771 Test1 is 12.86% faster than Test2
Output for 4.3.9
test1: 0.988898 test2: -0.009454
Output for 4.3.8
test1: -0.011191 test2: -0.00973 Test1 is 15.02% faster than Test2
Output for 4.3.7
test1: -0.009668 test2: -0.008298 Test1 is 16.51% faster than Test2
Output for 4.3.6
test1: -0.01158 test2: -0.0097299999999999 Test1 is 19.01% faster than Test2
Output for 4.3.5
test1: -0.00759 test2: -0.006761 Test1 is 12.26% faster than Test2
Output for 4.3.4
test1: -0.007977 test2: -0.007116 Test1 is 12.1% faster than Test2
Output for 4.3.3
test1: -0.011823 test2: -0.010338 Test1 is 14.36% faster than Test2
Output for 4.3.2
test1: -0.006692 test2: -0.005187 Test1 is 29.01% faster than Test2
Output for 4.3.1
test1: -0.010513 test2: -0.009826 Test1 is 6.99% faster than Test2
Output for 4.3.0
test1: -0.011145 test2: -0.009945 Test1 is 12.07% faster than Test2