3v4l.org

run code in 200+ 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 < 10000; $i++) { $t($i); } $timestampAfter = microtime(true); $memDiff = memory_get_usage() - $mem; $timeDiff = $timestampAfter-$timestamp; var_dump($memDiff, $timeDiff);
Output for 7.2.0
int(40) float(0.00065898895263672)
Output for 7.1.7
int(40) float(0.0005638599395752)
Output for 7.1.6
int(40) float(0.0013179779052734)
Output for 7.1.5
int(40) float(0.0008080005645752)
Output for 7.1.0
int(40) float(0.001147985458374)
Output for 7.0.20
int(40) float(0.00083518028259277)
Output for 7.0.14
int(40) float(0.0011630058288574)
Output for 7.0.12
int(40) float(0.0011858940124512)
Output for 7.0.6
int(40) float(0.0010559558868408)
Output for 7.0.5
int(40) float(0.00067400932312012)
Output for 7.0.4
int(40) float(0.0010299682617188)
Output for 7.0.3
int(40) float(0.00068998336791992)
Output for 7.0.2
int(40) float(0.00093388557434082)
Output for 7.0.1
int(40) float(0.00073909759521484)
Output for 7.0.0
int(40) float(0.001288890838623)
Output for 5.6.28
int(760) float(0.0033481121063232)
Output for 5.6.21
int(760) float(0.0023720264434814)
Output for 5.6.20
int(760) float(0.0022308826446533)
Output for 5.6.19
int(760) float(0.0019230842590332)
Output for 5.6.18
int(760) float(0.0020651817321777)
Output for 5.6.17
int(760) float(0.0022010803222656)
Output for 5.6.16
int(760) float(0.0036671161651611)
Output for 5.6.15
int(760) float(0.0027840137481689)
Output for 5.6.14
int(760) float(0.0034098625183105)
Output for 5.6.13
int(760) float(0.0022680759429932)
Output for 5.6.12
int(760) float(0.0025122165679932)
Output for 5.6.11
int(760) float(0.0022740364074707)
Output for 5.6.10
int(760) float(0.0024619102478027)
Output for 5.6.9
int(760) float(0.0022621154785156)
Output for 5.6.8
int(760) float(0.0027110576629639)
Output for 5.6.7
int(760) float(0.0038068294525146)
Output for 5.5.35
int(768) float(0.0028948783874512)
Output for 5.5.34
int(768) float(0.0042309761047363)
Output for 5.5.33
int(768) float(0.0020849704742432)
Output for 5.5.32
int(768) float(0.002140998840332)
Output for 5.5.31
int(768) float(0.0027780532836914)
Output for 5.5.30
int(768) float(0.0026810169219971)
Output for 5.5.29
int(768) float(0.0031168460845947)
Output for 5.5.28
int(768) float(0.0033230781555176)
Output for 5.5.27
int(768) float(0.0022380352020264)
Output for 5.5.26
int(768) float(0.0030181407928467)
Output for 5.5.25
int(768) float(0.003425121307373)
Output for 5.5.24
int(768) float(0.0033960342407227)
Output for 5.4.45
int(760) float(0.0024819374084473)
Output for 5.4.44
int(760) float(0.0023860931396484)
Output for 5.4.43
int(760) float(0.0022759437561035)
Output for 5.4.42
int(760) float(0.002363920211792)
Output for 5.4.41
int(760) float(0.0024950504302979)
Output for 5.4.40
int(760) float(0.0026209354400635)
Output for 5.4.39
int(760) float(0.0030629634857178)
Output for 5.4.38
int(760) float(0.0017509460449219)
Output for 5.4.37
int(760) float(0.002720832824707)
Output for 5.4.36
int(760) float(0.0016350746154785)
Output for 5.4.35
int(760) float(0.0022339820861816)
Output for 5.4.34
int(760) float(0.0022501945495605)
Output for 5.4.32
int(760) float(0.0018601417541504)
Output for 5.4.31
int(760) float(0.0016229152679443)
Output for 5.4.30
int(760) float(0.0017409324645996)
Output for 5.4.29
int(760) float(0.0018060207366943)
Output for 5.4.28
int(760) float(0.001554012298584)
Output for 5.4.27
int(760) float(0.0015649795532227)
Output for 5.4.26
int(760) float(0.0017271041870117)
Output for 5.4.25
int(760) float(0.001568078994751)
Output for 5.4.24
int(760) float(0.0016050338745117)
Output for 5.4.23
int(760) float(0.0015511512756348)
Output for 5.4.22
int(760) float(0.001615047454834)
Output for 5.4.21
int(760) float(0.0015950202941895)
Output for 5.4.20
int(760) float(0.0015480518341064)
Output for 5.4.19
int(760) float(0.0025849342346191)
Output for 5.4.18
int(760) float(0.001629114151001)
Output for 5.4.17
int(760) float(0.0016322135925293)
Output for 5.4.16
int(760) float(0.0018930435180664)
Output for 5.4.15
int(760) float(0.001662015914917)
Output for 5.4.14
int(760) float(0.0034289360046387)
Output for 5.4.13
int(760) float(0.0027320384979248)
Output for 5.4.12
int(760) float(0.0027189254760742)
Output for 5.4.11
int(760) float(0.0025870800018311)
Output for 5.4.10
int(760) float(0.0026140213012695)
Output for 5.4.9
int(776) float(0.0027029514312744)
Output for 5.4.8
int(776) float(0.0021240711212158)
Output for 5.4.7
int(776) float(0.0021209716796875)
Output for 5.4.6
int(776) float(0.0017800331115723)
Output for 5.4.5
int(776) float(0.0022678375244141)
Output for 5.4.4
int(776) float(0.0029220581054688)
Output for 5.4.3
int(776) float(0.0024778842926025)
Output for 5.4.2
int(776) float(0.0029211044311523)
Output for 5.4.1
int(776) float(0.0032048225402832)
Output for 5.4.0
int(776) float(0.0020279884338379)
Output for 5.3.29
int(944) float(0.0020148754119873)
Output for 5.3.28
int(944) float(0.0019960403442383)
Output for 5.3.27
int(944) float(0.0020182132720947)
Output for 5.3.26
int(944) float(0.0034830570220947)
Output for 5.3.25
int(944) float(0.0048689842224121)
Output for 5.3.24
int(944) float(0.003633975982666)
Output for 5.3.23
int(944) float(0.0030100345611572)
Output for 5.3.22
int(944) float(0.0032269954681396)
Output for 5.3.21
int(944) float(0.0028431415557861)
Output for 5.3.20
int(944) float(0.0031440258026123)
Output for 5.3.19
int(944) float(0.0024888515472412)
Output for 5.3.18
int(944) float(0.0033481121063232)
Output for 5.3.17
int(944) float(0.0022621154785156)
Output for 5.3.16
int(944) float(0.0031838417053223)
Output for 5.3.15
int(944) float(0.0039401054382324)
Output for 5.3.14
int(944) float(0.0035099983215332)
Output for 5.3.13
int(944) float(0.0020918846130371)
Output for 5.3.12
int(944) float(0.0030519962310791)
Output for 5.3.11
int(944) float(0.0029969215393066)
Output for 5.3.10
int(944) float(0.0020608901977539)
Output for 5.3.9
int(944) float(0.0029129981994629)
Output for 5.3.8
int(944) float(0.0021288394927979)
Output for 5.3.7
int(944) float(0.0020849704742432)
Output for 5.3.6
int(944) float(0.0035398006439209)
Output for 5.3.5
int(944) float(0.0039548873901367)
Output for 5.3.4
int(944) float(0.0035169124603271)
Output for 5.3.3
int(944) float(0.0035121440887451)
Output for 5.3.2
int(944) float(0.0020999908447266)
Output for 5.3.1
int(944) float(0.0033740997314453)
Output for 5.3.0
int(944) float(0.0033390522003174)
Output for 5.2.1 - 5.2.17
Fatal error: Function name must be a string in /in/kjpJG 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/kjpJG 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/kjpJG 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/kjpJG 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/kjpJG on line 5
Process exited with code 255.