3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Model { public function get() {} } class Foo { protected $model; public function __construct() { $this->model = new Model; } public function doSomethingGetModelOnce() { $model = $this->getModel(); for ($i = 0; $i < 1000000; $i++) { $model->get(); } } public function doSomethingGetModelNTimes() { for ($i = 0; $i < 1000000; $i++) { $this->getModel()->get(); } } protected function getModel() { return $this->model; } } $foo = new Foo(); $time0 = microtime(true); $foo->doSomethingGetModelOnce(); $time1 = microtime(true); $foo->doSomethingGetModelNTimes(); $time2 = microtime(true); var_dump(1000*($time1-$time0), 1000*($time2-$time1));
Output for 7.1.0
float(40.703058242798) float(66.423892974854)
Output for 7.0.14
float(42.196989059448) float(70.714950561523)
Output for 7.0.10
float(30.518054962158) float(61.594009399414)
Output for 7.0.9
float(36.23104095459) float(62.095880508423)
Output for 7.0.8
float(33.344030380249) float(62.97492980957)
Output for 7.0.7
float(35.084009170532) float(60.271024703979)
Output for 7.0.6
float(35.79306602478) float(60.158014297485)
Output for 7.0.5
float(34.64412689209) float(58.753967285156)
Output for 7.0.4
float(30.117034912109) float(53.086042404175)
Output for 7.0.3
float(34.777879714966) float(59.288024902344)
Output for 7.0.2
float(37.567138671875) float(59.268951416016)
Output for 7.0.1
float(38.174867630005) float(63.667058944702)
Output for 7.0.0
float(36.291837692261) float(56.951999664307)
Output for 5.6.28
float(113.2378578186) float(145.05815505981)
Output for 5.6.25
float(87.656021118164) float(123.08287620544)
Output for 5.6.24
float(92.665910720825) float(130.58400154114)
Output for 5.6.23
float(87.800979614258) float(121.18601799011)
Output for 5.6.22
float(73.837041854858) float(119.69709396362)
Output for 5.6.21
float(93.647003173828) float(128.68905067444)
Output for 5.6.20
float(84.300994873047) float(134.60087776184)
Output for 5.6.19
float(91.551065444946) float(149.20377731323)
Output for 5.6.18
float(79.340934753418) float(138.6411190033)
Output for 5.6.17
float(82.653999328613) float(131.26611709595)
Output for 5.6.16
float(77.075004577637) float(130.01203536987)
Output for 5.6.15
float(81.329107284546) float(123.05307388306)
Output for 5.6.14
float(84.42497253418) float(135.62798500061)
Output for 5.6.13
float(70.709943771362) float(142.0259475708)
Output for 5.6.12
float(85.602998733521) float(127.88200378418)
Output for 5.6.11
float(73.911905288696) float(132.55715370178)
Output for 5.6.10
float(76.98917388916) float(125.77295303345)
Output for 5.6.9
float(87.110042572021) float(130.99694252014)
Output for 5.6.8
float(91.926097869873) float(154.26588058472)
Output for 5.6.7
float(104.36391830444) float(135.6348991394)
Output for 5.6.6
float(79.827070236206) float(122.94483184814)
Output for 5.6.5
float(66.466093063354) float(120.94902992249)
Output for 5.6.4
float(65.016984939575) float(106.10198974609)
Output for 5.6.3
float(58.956861495972) float(104.81810569763)
Output for 5.6.2
float(88.044881820679) float(129.01711463928)
Output for 5.6.1
float(66.265821456909) float(125.42819976807)
Output for 5.6.0
float(94.660997390747) float(128.662109375)
Output for 5.5.38
float(79.859972000122) float(134.50813293457)
Output for 5.5.37
float(82.26203918457) float(133.9738368988)
Output for 5.5.36
float(66.583871841431) float(128.93199920654)
Output for 5.5.35
float(75.170040130615) float(132.46703147888)
Output for 5.5.34
float(83.670139312744) float(136.05904579163)
Output for 5.5.33
float(73.065996170044) float(133.45384597778)
Output for 5.5.32
float(86.114883422852) float(173.84600639343)
Output for 5.5.31
float(81.866979598999) float(146.49200439453)
Output for 5.5.30
float(70.751905441284) float(142.40121841431)
Output for 5.5.29
float(115.10300636292) float(147.01795578003)
Output for 5.5.28
float(76.298952102661) float(130.88512420654)
Output for 5.5.27
float(88.619947433472) float(171.1699962616)
Output for 5.5.26
float(73.781967163086) float(131.73389434814)
Output for 5.5.25
float(71.412801742554) float(131.54101371765)
Output for 5.5.24
float(76.719999313354) float(130.77306747437)
Output for 5.5.23
float(86.313962936401) float(136.56401634216)
Output for 5.5.22
float(82.504987716675) float(133.74495506287)
Output for 5.5.21
float(91.366052627563) float(136.96599006653)
Output for 5.5.20
float(72.459936141968) float(141.9370174408)
Output for 5.5.19
float(56.603908538818) float(111.98306083679)
Output for 5.5.18
float(61.061859130859) float(121.79112434387)
Output for 5.5.16
float(65.237045288086) float(129.75001335144)
Output for 5.5.15
float(78.346967697144) float(132.30800628662)
Output for 5.5.14
float(88.510990142822) float(145.89810371399)
Output for 5.5.13
float(75.278043746948) float(132.45391845703)
Output for 5.5.12
float(85.660219192505) float(134.43779945374)
Output for 5.5.11
float(74.503898620605) float(132.32898712158)
Output for 5.5.10
float(78.131914138794) float(130.43713569641)
Output for 5.5.9
float(74.146032333374) float(134.20796394348)
Output for 5.5.8
float(85.463047027588) float(165.67277908325)
Output for 5.5.7
float(66.51496887207) float(131.74700737)
Output for 5.5.6
float(80.425024032593) float(132.89189338684)
Output for 5.5.5
float(89.590072631836) float(136.95192337036)
Output for 5.5.4
float(91.930866241455) float(138.28897476196)
Output for 5.5.3
float(79.939126968384) float(140.53392410278)
Output for 5.5.2
float(71.465969085693) float(140.83695411682)
Output for 5.5.1
float(91.922044754028) float(175.73499679565)
Output for 5.5.0
float(124.33815002441) float(173.53987693787)
Output for 5.4.45
float(88.552951812744) float(126.89185142517)
Output for 5.4.44
float(72.626829147339) float(124.97305870056)
Output for 5.4.43
float(70.089101791382) float(123.60191345215)
Output for 5.4.42
float(77.901840209961) float(129.6751499176)
Output for 5.4.41
float(70.725917816162) float(127.46500968933)
Output for 5.4.40
float(86.277961730957) float(127.58493423462)
Output for 5.4.39
float(80.124855041504) float(124.08804893494)
Output for 5.4.38
float(89.545011520386) float(157.0930480957)
Output for 5.4.37
float(82.171201705933) float(131.32286071777)
Output for 5.4.36
float(65.047025680542) float(129.12893295288)
Output for 5.4.35
float(63.058853149414) float(132.36308097839)
Output for 5.4.34
float(63.199043273926) float(127.66194343567)
Output for 5.4.32
float(63.956022262573) float(133.33296775818)
Output for 5.4.31
float(67.591905593872) float(131.54006004333)
Output for 5.4.30
float(57.368040084839) float(114.14384841919)
Output for 5.4.29
float(68.898916244507) float(122.42794036865)
Output for 5.4.28
float(69.213151931763) float(124.61400032043)
Output for 5.4.27
float(84.841012954712) float(128.62801551819)
Output for 5.4.26
float(87.94093132019) float(125.02408027649)
Output for 5.4.25
float(78.513860702515) float(126.2321472168)
Output for 5.4.24
float(70.05786895752) float(123.49510192871)
Output for 5.4.23
float(71.017980575562) float(123.62813949585)
Output for 5.4.22
float(71.571826934814) float(124.29213523865)
Output for 5.4.21
float(77.972888946533) float(125.14400482178)
Output for 5.4.20
float(78.214883804321) float(126.54304504395)
Output for 5.4.19
float(79.452037811279) float(123.14200401306)
Output for 5.4.18
float(70.690870285034) float(124.95493888855)
Output for 5.4.17
float(88.300943374634) float(128.72004508972)
Output for 5.4.16
float(76.196193695068) float(129.80103492737)
Output for 5.4.15
float(86.874008178711) float(134.59014892578)
Output for 5.4.14
float(126.48797035217) float(141.1030292511)
Output for 5.4.13
float(95.849990844727) float(155.90691566467)
Output for 5.4.12
float(77.120065689087) float(129.29892539978)
Output for 5.4.11
float(80.902099609375) float(155.58099746704)
Output for 5.4.10
float(94.933032989502) float(136.14702224731)
Output for 5.4.9
float(91.965913772583) float(124.33505058289)
Output for 5.4.8
float(88.032007217407) float(134.87696647644)
Output for 5.4.7
float(70.035934448242) float(123.86107444763)
Output for 5.4.6
float(78.646898269653) float(141.37411117554)
Output for 5.4.5
float(73.786020278931) float(132.72190093994)
Output for 5.4.4
float(90.476989746094) float(141.82615280151)
Output for 5.4.3
float(86.902141571045) float(129.61578369141)
Output for 5.4.2
float(69.885969161987) float(126.69396400452)
Output for 5.4.1
float(92.530965805054) float(153.19514274597)
Output for 5.4.0
float(77.059984207153) float(129.46105003357)
Output for 5.3.29
float(134.8237991333) float(299.1681098938)
Output for 5.3.28
float(196.88296318054) float(352.97203063965)
Output for 5.3.27
float(156.36610984802) float(361.98592185974)
Output for 5.3.26
float(155.08484840393) float(333.02903175354)
Output for 5.3.25
float(163.04111480713) float(331.53486251831)
Output for 5.3.24
float(181.79297447205) float(336.1120223999)
Output for 5.3.23
float(169.68512535095) float(330.06691932678)
Output for 5.3.22
float(166.15009307861) float(330.15179634094)
Output for 5.3.21
float(181.65802955627) float(334.01989936829)
Output for 5.3.20
float(176.99694633484) float(351.98497772217)
Output for 5.3.19
float(164.38889503479) float(329.71096038818)
Output for 5.3.18
float(160.13693809509) float(342.2269821167)
Output for 5.3.17
float(170.7079410553) float(368.58987808228)
Output for 5.3.16
float(182.46006965637) float(329.85591888428)
Output for 5.3.15
float(177.40082740784) float(375.2429485321)
Output for 5.3.14
float(163.54608535767) float(332.95702934265)
Output for 5.3.13
float(186.0499382019) float(332.30686187744)
Output for 5.3.12
float(157.48620033264) float(330.20091056824)
Output for 5.3.11
float(159.30008888245) float(335.67905426025)
Output for 5.3.10
float(161.69118881226) float(330.22689819336)
Output for 5.3.9
float(180.94897270203) float(399.44410324097)
Output for 5.3.8
float(174.90696907043) float(368.45993995667)
Output for 5.3.7
float(168.89405250549) float(327.8648853302)
Output for 5.3.6
float(180.79400062561) float(338.90414237976)
Output for 5.3.5
float(150.56896209717) float(328.09495925903)
Output for 5.3.4
float(177.20603942871) float(329.89311218262)
Output for 5.3.3
float(157.45615959167) float(328.96780967712)
Output for 5.3.2
float(157.87482261658) float(335.7400894165)
Output for 5.3.1
float(164.55888748169) float(336.26198768616)
Output for 5.3.0
float(166.40210151672) float(336.02094650269)
Output for 5.2.17
float(200.47497749329) float(400.16007423401)
Output for 5.2.16
float(171.2851524353) float(406.92496299744)
Output for 5.2.15
float(184.35502052307) float(399.90901947021)
Output for 5.2.14
float(209.04493331909) float(399.09696578979)
Output for 5.2.13
float(188.08317184448) float(401.87692642212)
Output for 5.2.12
float(214.67804908752) float(400.09188652039)
Output for 5.2.11
float(212.18514442444) float(398.10490608215)
Output for 5.2.10
float(209.13100242615) float(460.3750705719)
Output for 5.2.9
float(221.68707847595) float(397.24707603455)
Output for 5.2.8
float(213.39106559753) float(423.51603507996)
Output for 5.2.7
float(204.11491394043) float(398.52905273438)
Output for 5.2.6
float(199.90181922913) float(394.3030834198)
Output for 5.2.5
float(200.22201538086) float(406.49199485779)
Output for 5.2.4
float(200.73699951172) float(401.14212036133)
Output for 5.2.3
float(179.51107025146) float(395.11489868164)
Output for 5.2.2
float(222.79906272888) float(400.30598640442)
Output for 5.2.1
float(208.08386802673) float(435.05620956421)
Output for 5.2.0
float(197.14784622192) float(395.0560092926)
Output for 5.1.6
float(181.74815177917) float(402.77290344238)
Output for 5.1.5
float(215.37899971008) float(399.75214004517)
Output for 5.1.4
float(203.15408706665) float(399.44291114807)
Output for 5.1.3
float(186.26999855042) float(381.09087944031)
Output for 5.1.2
float(163.38801383972) float(373.66008758545)
Output for 5.1.1
float(164.21604156494) float(384.35006141663)
Output for 5.1.0
float(157.76085853577) float(372.00903892517)
Output for 5.0.5
float(284.63792800903) float(441.95199012756)
Output for 5.0.4
float(306.68187141418) float(441.21694564819)
Output for 5.0.3
float(251.30081176758) float(427.71816253662)
Output for 5.0.2
float(263.29803466797) float(365.60702323914)
Output for 5.0.1
float(261.02805137634) float(371.95515632629)
Output for 5.0.0
float(280.92002868652) float(450.24800300598)
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/5Ig6e 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/5Ig6e 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/5Ig6e on line 5
Process exited with code 255.