3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Base { public function _($foo) { return $foo; } } $mem = memory_get_usage(); $timestamp = microtime(true); $base = new Base; $t = function($foo) use ($base) { return $base->_($foo); }; 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.1.0
int(736) float(0.0010709762573242)
Output for 7.0.14
int(736) float(0.0012919902801514)
Output for 7.0.12
int(736) float(0.0012331008911133)
Output for 7.0.6
int(736) float(0.0011768341064453)
Output for 7.0.5
int(736) float(0.00077199935913086)
Output for 7.0.4
int(736) float(0.0012261867523193)
Output for 7.0.3
int(736) float(0.00078892707824707)
Output for 7.0.2
int(736) float(0.00075793266296387)
Output for 7.0.1
int(736) float(0.001093864440918)
Output for 7.0.0
int(736) float(0.0011990070343018)
Output for hhvm-3.12.0
int(0) float(0.0020649433135986)
Output for hhvm-3.10.0
int(0) float(0.0024499893188477)
Output for 5.6.28
int(1504) float(0.0036389827728271)
Output for 5.6.21
int(1504) float(0.0040490627288818)
Output for 5.6.20
int(1504) float(0.0023550987243652)
Output for 5.6.19
int(1504) float(0.0028719902038574)
Output for 5.6.18
int(1504) float(0.0026600360870361)
Output for 5.6.17
int(1504) float(0.0023918151855469)
Output for 5.6.16
int(1504) float(0.0037491321563721)
Output for 5.6.15
int(1504) float(0.0023970603942871)
Output for 5.6.14
int(1504) float(0.0030851364135742)
Output for 5.6.13
int(1504) float(0.0029571056365967)
Output for 5.6.12
int(1504) float(0.0031669139862061)
Output for 5.6.11
int(1504) float(0.003925085067749)
Output for 5.6.10
int(1504) float(0.0040562152862549)
Output for 5.6.9
int(1504) float(0.003666877746582)
Output for 5.6.8
int(1504) float(0.0028030872344971)
Output for 5.6.7
int(1504) float(0.0024080276489258)
Output for 5.5.35
int(1480) float(0.002647876739502)
Output for 5.5.34
int(1480) float(0.0039501190185547)
Output for 5.5.33
int(1480) float(0.0030090808868408)
Output for 5.5.32
int(1480) float(0.0026638507843018)
Output for 5.5.31
int(1480) float(0.0035269260406494)
Output for 5.5.30
int(1480) float(0.0036671161651611)
Output for 5.5.29
int(1480) float(0.0035400390625)
Output for 5.5.28
int(1480) float(0.0038201808929443)
Output for 5.5.27
int(1480) float(0.002424955368042)
Output for 5.5.26
int(1480) float(0.0027890205383301)
Output for 5.5.25
int(1480) float(0.0042579174041748)
Output for 5.5.24
int(1480) float(0.0038268566131592)
Output for 5.4.27, 5.4.45
int(1472) float(0.0029850006103516)
Output for 5.4.44
int(1472) float(0.0026140213012695)
Output for 5.4.43
int(1472) float(0.0018770694732666)
Output for 5.4.42
int(1472) float(0.0031590461730957)
Output for 5.4.41
int(1472) float(0.0019359588623047)
Output for 5.4.40
int(1472) float(0.0026500225067139)
Output for 5.4.39
int(1472) float(0.0028011798858643)
Output for 5.4.38
int(1472) float(0.0029489994049072)
Output for 5.4.37
int(1472) float(0.0022249221801758)
Output for 5.4.36
int(1472) float(0.0025229454040527)
Output for 5.4.35
int(1472) float(0.0031380653381348)
Output for 5.4.34
int(1472) float(0.0028591156005859)
Output for 5.4.32
int(1472) float(0.0029001235961914)
Output for 5.4.31
int(1472) float(0.0019960403442383)
Output for 5.4.30
int(1472) float(0.0021278858184814)
Output for 5.4.29
int(1472) float(0.0027549266815186)
Output for 5.4.28
int(1472) float(0.002255916595459)
Output for 5.4.26
int(1472) float(0.0019731521606445)
Output for 5.4.25
int(1472) float(0.0020790100097656)
Output for 5.4.24
int(1472) float(0.0030519962310791)
Output for 5.4.23
int(1472) float(0.0028619766235352)
Output for 5.4.22
int(1472) float(0.0029408931732178)
Output for 5.4.21
int(1472) float(0.002608060836792)
Output for 5.4.20
int(1472) float(0.0035209655761719)
Output for 5.4.19
int(1472) float(0.0031070709228516)
Output for 5.4.18
int(1472) float(0.0020132064819336)
Output for 5.4.12, 5.4.17
int(1472) float(0.0025699138641357)
Output for 5.4.16
int(1472) float(0.0029020309448242)
Output for 5.4.15
int(1472) float(0.0024139881134033)
Output for 5.4.14
int(1472) float(0.0030949115753174)
Output for 5.4.13
int(1472) float(0.002694845199585)
Output for 5.4.11
int(1472) float(0.0026350021362305)
Output for 5.4.10
int(1472) float(0.00313401222229)
Output for 5.4.9
int(1472) float(0.0033481121063232)
Output for 5.4.8
int(1472) float(0.003154993057251)
Output for 5.4.7
int(1472) float(0.0024039745330811)
Output for 5.4.6
int(1472) float(0.0028138160705566)
Output for 5.4.5
int(1472) float(0.0030148029327393)
Output for 5.4.4
int(1472) float(0.0029768943786621)
Output for 5.4.3
int(1472) float(0.0030019283294678)
Output for 5.4.2
int(1472) float(0.0027379989624023)
Output for 5.4.1
int(1472) float(0.0032520294189453)
Output for 5.4.0
int(1472) float(0.0020079612731934)
Output for 5.3.29
int(1968) float(0.002363920211792)
Output for 5.3.28
int(1968) float(0.0029399394989014)
Output for 5.3.27
int(1968) float(0.0037879943847656)
Output for 5.3.26
int(1968) float(0.004108190536499)
Output for 5.3.25
int(1968) float(0.0031330585479736)
Output for 5.3.24
int(1968) float(0.0041038990020752)
Output for 5.3.23
int(1968) float(0.0036020278930664)
Output for 5.3.22
int(1968) float(0.0039241313934326)
Output for 5.3.21
int(1968) float(0.004040002822876)
Output for 5.3.20
int(1968) float(0.0040090084075928)
Output for 5.3.19
int(1968) float(0.0038390159606934)
Output for 5.3.18
int(1968) float(0.0034198760986328)
Output for 5.3.17
int(1968) float(0.0023910999298096)
Output for 5.3.16
int(1968) float(0.0027470588684082)
Output for 5.3.15
int(1968) float(0.0035238265991211)
Output for 5.3.14
int(1968) float(0.0038678646087646)
Output for 5.3.13
int(1968) float(0.0024261474609375)
Output for 5.3.12
int(1968) float(0.0039200782775879)
Output for 5.3.11
int(1968) float(0.0027878284454346)
Output for 5.3.10
int(1968) float(0.0038919448852539)
Output for 5.3.9
int(1968) float(0.002485990524292)
Output for 5.3.8
int(1968) float(0.0024640560150146)
Output for 5.3.7
int(1968) float(0.0036940574645996)
Output for 5.3.6
int(1968) float(0.0032639503479004)
Output for 5.3.5
int(1968) float(0.0040340423583984)
Output for 5.3.4
int(1968) float(0.0024271011352539)
Output for 5.3.3
int(1968) float(0.0024111270904541)
Output for 5.3.2
int(1968) float(0.0024230480194092)
Output for 5.3.1
int(1968) float(0.0030598640441895)
Output for 5.3.0
int(1960) float(0.0025010108947754)
Output for 5.1.0 - 5.2.17
Parse error: syntax error, unexpected T_FUNCTION in /in/nocI7 on line 15
Process exited with code 255.
Output for 5.0.0 - 5.0.5
Parse error: parse error, unexpected T_FUNCTION in /in/nocI7 on line 15
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/nocI7 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/nocI7 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/nocI7 on line 5
Process exited with code 255.