3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class SomeObj { public function doTest() {} } $someObj = new SomeObj; class SomeClass { public static function doTest() {;} } // bench static method $starttime = microtime(true); for ($i = 0; $i< 100000; $i++) SomeClass::doTest($i); echo "Static Time: " , (microtime(true)-$starttime) , " ms\n"; // bench object method $starttime = microtime(true); for ($i = 0; $i< 10*1000*1000; $i++) $someObj->doTest($i); echo "Object Time: " , (microtime(true)-$starttime) , " ms\n";
Output for 7.1.0
Static Time: 0.0046300888061523 ms Object Time: 0.35813903808594 ms
Output for 7.0.14
Static Time: 0.0048000812530518 ms Object Time: 0.32937598228455 ms
Output for 7.0.6
Static Time: 0.0032060146331787 ms Object Time: 0.32782006263733 ms
Output for 7.0.5
Static Time: 0.003673791885376 ms Object Time: 0.33084201812744 ms
Output for 7.0.4
Static Time: 0.0077171325683594 ms Object Time: 0.39741611480713 ms
Output for 7.0.3
Static Time: 0.0045719146728516 ms Object Time: 0.3394730091095 ms
Output for 7.0.2
Static Time: 0.0069229602813721 ms Object Time: 0.38135695457458 ms
Output for 7.0.1
Static Time: 0.0040340423583984 ms Object Time: 0.33864498138428 ms
Output for 7.0.0
Static Time: 0.0028998851776123 ms Object Time: 0.32062005996704 ms
Output for 5.6.28
Static Time: 0.012660980224609 ms Object Time: 0.0095469951629639 ms
Output for 5.6.21
Static Time: 0.0077090263366699 ms Object Time: 0.95492100715637 ms
Output for 5.6.20
Static Time: 0.0091679096221924 ms Object Time: 0.82581686973572 ms
Output for 5.6.19
Static Time: 0.010057926177979 ms Object Time: 0.8261501789093 ms
Output for 5.6.18
Static Time: 0.0066590309143066 ms Object Time: 0.82982897758484 ms
Output for 5.6.17
Static Time: 0.006788969039917 ms Object Time: 0.80909299850464 ms
Output for 5.6.16
Static Time: 0.010145902633667 ms Object Time: 0.85850405693054 ms
Output for 5.6.15
Static Time: 0.011844873428345 ms Object Time: 0.81647396087646 ms
Output for 5.6.14
Static Time: 0.0068559646606445 ms Object Time: 0.82668209075928 ms
Output for 5.6.13
Static Time: 0.0066719055175781 ms Object Time: 0.81998085975647 ms
Output for 5.6.12
Static Time: 0.0062921047210693 ms Object Time: 0.79390096664429 ms
Output for 5.6.11
Static Time: 0.0091838836669922 ms Object Time: 0.83916807174683 ms
Output for 5.6.10
Static Time: 0.010897159576416 ms Object Time: 0.89259505271912 ms
Output for 5.6.9
Static Time: 0.0096609592437744 ms Object Time: 0.8466260433197 ms
Output for 5.6.8
Static Time: 0.0088210105895996 ms Object Time: 0.87759399414062 ms
Output for 5.6.7
Static Time: 0.010300874710083 ms Object Time: 0.8877911567688 ms
Output for 5.5.35
Static Time: 0.009023904800415 ms Object Time: 0.84770488739014 ms
Output for 5.5.34
Static Time: 0.0083131790161133 ms Object Time: 1.0824201107025 ms
Output for 5.5.33
Static Time: 0.0083498954772949 ms Object Time: 0.81965398788452 ms
Output for 5.5.32
Static Time: 0.0092079639434814 ms Object Time: 0.82342910766602 ms
Output for 5.5.31
Static Time: 0.0095629692077637 ms Object Time: 0.8507251739502 ms
Output for 5.5.30
Static Time: 0.0096249580383301 ms Object Time: 0.82985401153564 ms
Output for 5.5.29
Static Time: 0.0068359375 ms Object Time: 0.8012580871582 ms
Output for 5.5.28
Static Time: 0.0093331336975098 ms Object Time: 0.82275795936584 ms
Output for 5.5.27
Static Time: 0.006443977355957 ms Object Time: 0.82192301750183 ms
Output for 5.5.26
Static Time: 0.0062811374664307 ms Object Time: 0.84548401832581 ms
Output for 5.5.25
Static Time: 0.0068190097808838 ms Object Time: 0.80319714546204 ms
Output for 5.5.24
Static Time: 0.0072228908538818 ms Object Time: 0.8345308303833 ms
Output for 5.4.45
Static Time: 0.0088391304016113 ms Object Time: 1.2298650741577 ms
Output for 5.4.44
Static Time: 0.0087110996246338 ms Object Time: 1.2728509902954 ms
Output for 5.4.43
Static Time: 0.0094630718231201 ms Object Time: 1.6334278583527 ms
Output for 5.4.42
Static Time: 0.011079072952271 ms Object Time: 1.5431950092316 ms
Output for 5.4.41
Static Time: 0.0096871852874756 ms Object Time: 1.7709591388702 ms
Output for 5.4.40
Static Time: 0.0095031261444092 ms Object Time: 1.1742899417877 ms
Output for 5.4.39
Static Time: 0.0097479820251465 ms Object Time: 1.4551169872284 ms
Output for 5.4.38
Static Time: 0.0090110301971436 ms Object Time: 1.2388730049133 ms
Output for 5.4.37
Static Time: 0.0088479518890381 ms Object Time: 1.7511329650879 ms
Output for 5.4.36
Static Time: 0.012467861175537 ms Object Time: 1.2765321731567 ms
Output for 5.4.35
Static Time: 0.0065500736236572 ms Object Time: 0.95116782188416 ms
Output for 5.4.34
Static Time: 0.0088250637054443 ms Object Time: 0.94846510887146 ms
Output for 5.4.32
Static Time: 0.0066299438476562 ms Object Time: 0.85477805137634 ms
Output for 5.4.31
Static Time: 0.0065019130706787 ms Object Time: 1.0040049552917 ms
Output for 5.4.30
Static Time: 0.0064120292663574 ms Object Time: 0.83725214004517 ms
Output for 5.4.29
Static Time: 0.0086178779602051 ms Object Time: 1.2631998062134 ms
Output for 5.4.28
Static Time: 0.0067429542541504 ms Object Time: 1.0253140926361 ms
Output for 5.4.27
Static Time: 0.0071990489959717 ms Object Time: 0.89813208580017 ms
Output for 5.4.26
Static Time: 0.0069279670715332 ms Object Time: 0.98000502586365 ms
Output for 5.4.25
Static Time: 0.0069611072540283 ms Object Time: 1.106390953064 ms
Output for 5.4.24
Static Time: 0.0073239803314209 ms Object Time: 0.90717005729675 ms
Output for 5.4.23
Static Time: 0.007004976272583 ms Object Time: 0.8818039894104 ms
Output for 5.4.22
Static Time: 0.0084891319274902 ms Object Time: 1.1187810897827 ms
Output for 5.4.21
Static Time: 0.0071771144866943 ms Object Time: 0.94067621231079 ms
Output for 5.4.20
Static Time: 0.008652925491333 ms Object Time: 1.0875380039215 ms
Output for 5.4.19
Static Time: 0.007317066192627 ms Object Time: 0.97684288024902 ms
Output for 5.4.18
Static Time: 0.0070269107818604 ms Object Time: 0.92206406593323 ms
Output for 5.4.17
Static Time: 0.0070009231567383 ms Object Time: 0.95507597923279 ms
Output for 5.4.16
Static Time: 0.0072321891784668 ms Object Time: 0.97308421134949 ms
Output for 5.4.15
Static Time: 0.0071108341217041 ms Object Time: 0.97399806976318 ms
Output for 5.4.14
Static Time: 0.0070419311523438 ms Object Time: 0.91720509529114 ms
Output for 5.4.13
Static Time: 0.012476205825806 ms Object Time: 0.86798286437988 ms
Output for 5.4.12
Static Time: 0.0067660808563232 ms Object Time: 0.90652799606323 ms
Output for 5.4.11
Static Time: 0.0069539546966553 ms Object Time: 0.914302110672 ms
Output for 5.4.10
Static Time: 0.0066628456115723 ms Object Time: 0.92979907989502 ms
Output for 5.4.9
Static Time: 0.0070669651031494 ms Object Time: 0.91092205047607 ms
Output for 5.4.8
Static Time: 0.0070791244506836 ms Object Time: 0.90412092208862 ms
Output for 5.4.7
Static Time: 0.0069241523742676 ms Object Time: 1.09339594841 ms
Output for 5.4.6
Static Time: 0.0089521408081055 ms Object Time: 1.1337180137634 ms
Output for 5.4.5
Static Time: 0.006598949432373 ms Object Time: 0.92593693733215 ms
Output for 5.4.4
Static Time: 0.007037878036499 ms Object Time: 0.92165207862854 ms
Output for 5.4.3
Static Time: 0.0088479518890381 ms Object Time: 1.1166219711304 ms
Output for 5.4.2
Static Time: 0.0067780017852783 ms Object Time: 0.90399789810181 ms
Output for 5.4.1
Static Time: 0.0067028999328613 ms Object Time: 1.1087658405304 ms
Output for 5.4.0
Static Time: 0.0069189071655273 ms Object Time: 0.98890209197998 ms
Output for 5.3.29
Static Time: 0.015429019927979 ms Object Time: 1.3433740139008 ms
Output for 5.3.28
Static Time: 0.015486001968384 ms Object Time: 1.5297908782959 ms
Output for 5.3.27
Static Time: 0.015445947647095 ms Object Time: 1.4108510017395 ms
Output for 5.3.26
Static Time: 0.016337871551514 ms Object Time: 1.4291391372681 ms
Output for 5.3.25
Static Time: 0.015631198883057 ms Object Time: 1.6350688934326 ms
Output for 5.3.24
Static Time: 0.015649795532227 ms Object Time: 1.4862489700317 ms
Output for 5.3.23
Static Time: 0.015684127807617 ms Object Time: 1.402909040451 ms
Output for 5.3.22
Static Time: 0.016363859176636 ms Object Time: 1.6305339336395 ms
Output for 5.3.21
Static Time: 0.01515007019043 ms Object Time: 1.4981071949005 ms
Output for 5.3.20
Static Time: 0.015549898147583 ms Object Time: 1.4469199180603 ms
Output for 5.3.19
Static Time: 0.015463829040527 ms Object Time: 1.4386119842529 ms
Output for 5.3.18
Static Time: 0.014959096908569 ms Object Time: 1.4722199440002 ms
Output for 5.3.17
Static Time: 0.014925956726074 ms Object Time: 1.4830610752106 ms
Output for 5.3.16
Static Time: 0.016880035400391 ms Object Time: 1.4241638183594 ms
Output for 5.3.15
Static Time: 0.015973806381226 ms Object Time: 1.4202318191528 ms
Output for 5.3.14
Static Time: 0.015695095062256 ms Object Time: 1.4297308921814 ms
Output for 5.3.13
Static Time: 0.02065896987915 ms Object Time: 1.5263979434967 ms
Output for 5.3.12
Static Time: 0.015898942947388 ms Object Time: 1.4677340984344 ms
Output for 5.3.11
Static Time: 0.017593145370483 ms Object Time: 1.7753701210022 ms
Output for 5.3.10
Static Time: 0.015040874481201 ms Object Time: 1.4493319988251 ms
Output for 5.3.9
Static Time: 0.016312837600708 ms Object Time: 1.4693319797516 ms
Output for 5.3.8
Static Time: 0.02294397354126 ms Object Time: 1.4918110370636 ms
Output for 5.3.7
Static Time: 0.016275882720947 ms Object Time: 1.4404242038727 ms
Output for 5.3.6
Static Time: 0.015569925308228 ms Object Time: 1.566654920578 ms
Output for 5.3.5
Static Time: 0.017383813858032 ms Object Time: 1.7225298881531 ms
Output for 5.3.4
Static Time: 0.032846927642822 ms Object Time: 1.6823329925537 ms
Output for 5.3.3
Static Time: 0.015704154968262 ms Object Time: 1.4581451416016 ms
Output for 5.3.2
Static Time: 0.018628120422363 ms Object Time: 1.5773189067841 ms
Output for 5.3.1
Static Time: 0.017045021057129 ms Object Time: 1.6118161678314 ms
Output for 5.3.0
Static Time: 0.01567006111145 ms Object Time: 1.4677782058716 ms
Output for 5.2.17
Static Time: 0.019401073455811 ms Object Time: 1.8631868362427 ms
Output for 5.2.16
Static Time: 0.018404960632324 ms Object Time: 1.9247031211853 ms
Output for 5.2.15
Static Time: 0.018740177154541 ms Object Time: 1.8207170963287 ms
Output for 5.2.14
Static Time: 0.024734020233154 ms Object Time: 1.8826529979706 ms
Output for 5.2.13
Static Time: 0.020985841751099 ms Object Time: 2.1746108531952 ms
Output for 5.2.12
Static Time: 0.019052028656006 ms Object Time: 1.8586840629578 ms
Output for 5.2.11
Static Time: 0.025869846343994 ms
Process exited with code 137.
Output for 5.2.10
Static Time: 0.030479907989502 ms Object Time: 1.9081020355225 ms
Output for 5.2.9
Static Time: 0.017761945724487 ms Object Time: 1.8783779144287 ms
Output for 5.2.8
Static Time: 0.022684812545776 ms Object Time: 1.8663549423218 ms
Output for 5.2.7
Static Time: 0.019663095474243 ms Object Time: 1.947701215744 ms
Output for 5.2.6
Static Time: 0.019807100296021 ms Object Time: 2.0663340091705 ms
Output for 5.2.5
Static Time: 0.016869068145752 ms Object Time: 1.7938470840454 ms
Output for 5.2.4
Static Time: 0.017578125 ms Object Time: 1.9983251094818 ms
Output for 5.2.3
Static Time: 0.022729873657227 ms Object Time: 1.9314169883728 ms
Output for 5.2.2
Static Time: 0.017431020736694 ms Object Time: 1.896301984787 ms
Output for 5.2.1
Static Time: 0.030550003051758 ms Object Time: 1.7576448917389 ms
Output for 5.2.0
Static Time: 0.017714977264404 ms Object Time: 1.9873368740082 ms
Output for 5.1.6
Static Time: 0.030735015869141 ms Object Time: 1.9596390724182 ms
Output for 5.1.5
Static Time: 0.018366098403931 ms Object Time: 1.8363258838654 ms
Output for 5.1.4
Static Time: 0.022675037384033 ms
Process exited with code 137.
Output for 5.1.3
Static Time: 0.017673015594482 ms Object Time: 1.8108639717102 ms
Output for 5.1.2
Static Time: 0.029823064804077 ms Object Time: 1.7961609363556 ms
Output for 5.1.1
Static Time: 0.020892858505249 ms Object Time: 1.795520067215 ms
Output for 5.1.0
Static Time: 0.017659187316895 ms Object Time: 1.7580738067627 ms
Output for 5.0.5
Static Time: 0.072829961776733 ms
Process exited with code 137.
Output for 5.0.4
Static Time: 0.027750968933105 ms
Process exited with code 137.
Output for 5.0.3
Static Time: 0.03816294670105 ms
Process exited with code 137.
Output for 5.0.2
Static Time: 0.062652111053467 ms
Process exited with code 137.
Output for 5.0.1
Static Time: 0.035184860229492 ms
Process exited with code 137.
Output for 5.0.0
Static Time: 0.026195049285889 ms
Process exited with code 137.
Output for 4.4.2 - 4.4.9
Parse error: syntax error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/EXN1a on line 5
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1
Parse error: parse error, unexpected T_STRING, expecting T_OLD_FUNCTION or T_FUNCTION or T_VAR or '}' in /in/EXN1a on line 5
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `T_OLD_FUNCTION' or `T_FUNCTION' or `T_VAR' or `'}'' in /in/EXN1a on line 5
Process exited with code 255.