3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Base { public function _($foo) { return $foo; } } class T extends Base { public function __invoke($foo) { return $this->_($foo); } } $mem = memory_get_usage(); $timestamp = microtime(true); $t = new T(); for ($i = 0; $i < 1000; $i++) { $t($i); } $timestampAfter = microtime(true); $memDiff = memory_get_usage() - $mem; $timeDiff = $timestampAfter-$timestamp; var_dump($memDiff, $timeDiff);
Output for 7.1.0
int(40) float(0.00011396408081055)
Output for 7.0.14
int(40) float(0.00011801719665527)
Output for 7.0.12
int(40) float(0.00011682510375977)
Output for 7.0.6
int(40) float(7.9154968261719E-5)
Output for 7.0.5
int(40) float(0.00010204315185547)
Output for 7.0.4
int(40) float(8.5115432739258E-5)
Output for 7.0.3
int(40) float(6.9856643676758E-5)
Output for 7.0.2
int(40) float(0.00013399124145508)
Output for 7.0.1
int(40) float(7.3909759521484E-5)
Output for 7.0.0
int(40) float(0.00011110305786133)
Output for hhvm-3.12.0
int(0) float(0.0001988410949707)
Output for hhvm-3.10.0
int(0) float(0.00029206275939941)
Output for 5.6.28
int(760) float(0.00033903121948242)
Output for 5.6.21
int(760) float(0.00039315223693848)
Output for 5.6.20
int(760) float(0.00035500526428223)
Output for 5.6.19
int(760) float(0.00017690658569336)
Output for 5.4.44, 5.6.18
int(760) float(0.00016903877258301)
Output for 5.4.13, 5.6.17
int(760) float(0.00022506713867188)
Output for 5.6.16
int(760) float(0.00022697448730469)
Output for 5.6.15
int(760) float(0.00029921531677246)
Output for 5.6.14
int(760) float(0.00023293495178223)
Output for 5.6.13
int(760) float(0.00037789344787598)
Output for 5.6.12
int(760) float(0.00032711029052734)
Output for 5.6.11
int(760) float(0.00031685829162598)
Output for 5.6.10
int(760) float(0.00034189224243164)
Output for 5.6.9
int(760) float(0.00035905838012695)
Output for 5.6.8
int(760) float(0.00027298927307129)
Output for 5.6.7
int(760) float(0.0002291202545166)
Output for 5.5.35
int(768) float(0.00036191940307617)
Output for 5.5.34
int(768) float(0.00022387504577637)
Output for 5.5.33
int(768) float(0.00020003318786621)
Output for 5.5.32
int(768) float(0.00022602081298828)
Output for 5.5.31
int(768) float(0.00028514862060547)
Output for 5.5.30
int(768) float(0.0003359317779541)
Output for 5.5.29
int(768) float(0.00036382675170898)
Output for 5.5.28
int(768) float(0.00036215782165527)
Output for 5.5.27
int(768) float(0.00040984153747559)
Output for 5.5.26
int(768) float(0.00034713745117188)
Output for 5.5.25
int(768) float(0.00034689903259277)
Output for 5.5.24
int(768) float(0.00027203559875488)
Output for 5.4.45
int(760) float(0.0001838207244873)
Output for 5.4.43
int(760) float(0.00030398368835449)
Output for 5.4.42
int(760) float(0.0001680850982666)
Output for 5.4.41
int(760) float(0.00017619132995605)
Output for 5.4.37, 5.4.40
int(760) float(0.00016999244689941)
Output for 5.4.39
int(760) float(0.00018715858459473)
Output for 5.4.38
int(760) float(0.00021004676818848)
Output for 5.4.32, 5.4.36
int(760) float(0.0001828670501709)
Output for 5.4.35
int(760) float(0.00028896331787109)
Output for 5.4.34
int(760) float(0.00025510787963867)
Output for 5.4.31
int(760) float(0.00017189979553223)
Output for 5.4.30
int(760) float(0.00022315979003906)
Output for 5.4.29
int(760) float(0.00025296211242676)
Output for 5.4.28
int(760) float(0.00021910667419434)
Output for 5.4.27
int(760) float(0.00026893615722656)
Output for 5.4.26
int(760) float(0.00025391578674316)
Output for 5.4.25
int(760) float(0.00019693374633789)
Output for 5.4.24
int(760) float(0.00023198127746582)
Output for 5.4.23
int(760) float(0.00026488304138184)
Output for 5.4.22
int(760) float(0.00026822090148926)
Output for 5.4.21
int(760) float(0.00020694732666016)
Output for 5.4.20
int(760) float(0.00026297569274902)
Output for 5.4.19
int(760) float(0.00024104118347168)
Output for 5.4.18
int(760) float(0.00025796890258789)
Output for 5.4.17
int(760) float(0.00018191337585449)
Output for 5.4.16
int(760) float(0.00023317337036133)
Output for 5.4.15
int(760) float(0.00020098686218262)
Output for 5.4.14
int(760) float(0.00024986267089844)
Output for 5.4.12
int(760) float(0.00025200843811035)
Output for 5.4.11
int(760) float(0.00032997131347656)
Output for 5.4.10
int(760) float(0.00023102760314941)
Output for 5.4.9
int(776) float(0.00027704238891602)
Output for 5.4.8
int(776) float(0.00028204917907715)
Output for 5.4.7
int(776) float(0.00024700164794922)
Output for 5.4.6
int(776) float(0.00029706954956055)
Output for 5.4.5
int(776) float(0.00022792816162109)
Output for 5.4.4
int(776) float(0.0002589225769043)
Output for 5.4.3
int(776) float(0.00026297569274902)
Output for 5.4.2
int(776) float(0.00019502639770508)
Output for 5.4.1
int(776) float(0.0001678466796875)
Output for 5.4.0
int(776) float(0.00060606002807617)
Output for 5.3.6, 5.3.29
int(944) float(0.00028896331787109)
Output for 5.3.28
int(944) float(0.00030088424682617)
Output for 5.3.27
int(944) float(0.00028109550476074)
Output for 5.3.26
int(944) float(0.00032496452331543)
Output for 5.3.25
int(944) float(0.00026988983154297)
Output for 5.3.24
int(944) float(0.00023412704467773)
Output for 5.3.23
int(944) float(0.00024795532226562)
Output for 5.3.22
int(944) float(0.00028800964355469)
Output for 5.3.11, 5.3.21
int(944) float(0.00033879280090332)
Output for 5.3.20
int(944) float(0.00034213066101074)
Output for 5.3.19
int(944) float(0.00025582313537598)
Output for 5.3.18
int(944) float(0.00042414665222168)
Output for 5.3.17
int(944) float(0.00031590461730957)
Output for 5.3.16
int(944) float(0.0002131462097168)
Output for 5.3.15
int(944) float(0.00031900405883789)
Output for 5.3.14
int(944) float(0.00031805038452148)
Output for 5.3.13
int(944) float(0.0002138614654541)
Output for 5.3.12
int(944) float(0.00023508071899414)
Output for 5.3.10
int(944) float(0.00034308433532715)
Output for 5.3.9
int(944) float(0.00033712387084961)
Output for 5.3.8
int(944) float(0.00030803680419922)
Output for 5.3.7
int(944) float(0.00061392784118652)
Output for 5.3.5
int(944) float(0.00021815299987793)
Output for 5.3.4
int(944) float(0.00027799606323242)
Output for 5.3.3
int(944) float(0.00021600723266602)
Output for 5.3.2
int(944) float(0.00025486946105957)
Output for 5.3.1
int(944) float(0.00022006034851074)
Output for 5.3.0
int(944) float(0.0003201961517334)
Output for 5.2.1 - 5.2.17
Fatal error: Function name must be a string in /in/ePZ0o on line 24
Process exited with code 255.
Output for 5.0.0 - 5.2.0
Fatal error: Call to undefined function memory_get_usage() in /in/ePZ0o on line 18
Process exited with code 255.
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/ePZ0o 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/ePZ0o 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/ePZ0o on line 5
Process exited with code 255.