3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class Test { public function method() { } } $obj = new Test; $ref = new ReflectionMethod($obj, 'method'); $closure = $ref->getClosure($obj); echo "Starting loop..."; $start = microtime(true); for ($i=0; $i<1e6; $i++) { $obj->method(array()); } echo "Took ", number_format((microtime(true)-$start)*1e3, 3), " ms";
Output for 7.1.0
Starting loop...Took 58.910 ms
Output for 7.0.14
Starting loop...Took 76.106 ms
Output for 7.0.12
Starting loop...Took 74.968 ms
Output for 7.0.6
Starting loop...Took 71.268 ms
Output for 7.0.5
Starting loop...Took 51.051 ms
Output for 7.0.4
Starting loop...Took 52.009 ms
Output for 7.0.3
Starting loop...Took 52.154 ms
Output for 7.0.2
Starting loop...Took 61.927 ms
Output for 7.0.1
Starting loop...Took 63.244 ms
Output for 7.0.0
Starting loop...Took 64.362 ms
Output for hhvm-3.12.0
Starting loop...Took 133.600 ms
Output for hhvm-3.10.0
Starting loop...Took 165.034 ms
Output for 5.6.28
Starting loop...Took 134.154 ms
Output for 5.6.21
Starting loop...Took 159.969 ms
Output for 5.6.20
Starting loop...Took 159.587 ms
Output for 5.6.19
Starting loop...Took 102.061 ms
Output for 5.6.18
Starting loop...Took 101.191 ms
Output for 5.6.17
Starting loop...Took 156.508 ms
Output for 5.6.16
Starting loop...Took 168.994 ms
Output for 5.6.15
Starting loop...Took 176.052 ms
Output for 5.6.14
Starting loop...Took 165.693 ms
Output for 5.6.13
Starting loop...Took 175.171 ms
Output for 5.6.12
Starting loop...Took 162.511 ms
Output for 5.6.11
Starting loop...Took 179.688 ms
Output for 5.6.10
Starting loop...Took 188.956 ms
Output for 5.6.9
Starting loop...Took 186.795 ms
Output for 5.6.8
Starting loop...Took 159.209 ms
Output for 5.6.7
Starting loop...Took 180.319 ms
Output for 5.5.35
Starting loop...Took 159.476 ms
Output for 5.5.34
Starting loop...Took 186.433 ms
Output for 5.5.33
Starting loop...Took 102.251 ms
Output for 5.5.32
Starting loop...Took 115.349 ms
Output for 5.5.31
Starting loop...Took 156.169 ms
Output for 5.5.30
Starting loop...Took 170.651 ms
Output for 5.5.29
Starting loop...Took 166.521 ms
Output for 5.5.28
Starting loop...Took 159.508 ms
Output for 5.5.27
Starting loop...Took 217.442 ms
Output for 5.5.26
Starting loop...Took 179.010 ms
Output for 5.5.25
Starting loop...Took 188.204 ms
Output for 5.5.24
Starting loop...Took 185.485 ms
Output for 5.4.45
Starting loop...Took 98.709 ms
Output for 5.4.44
Starting loop...Took 112.743 ms
Output for 5.4.43
Starting loop...Took 123.400 ms
Output for 5.4.42
Starting loop...Took 108.851 ms
Output for 5.4.41
Starting loop...Took 99.091 ms
Output for 5.4.40
Starting loop...Took 123.743 ms
Output for 5.4.39
Starting loop...Took 99.342 ms
Output for 5.4.38
Starting loop...Took 100.823 ms
Output for 5.4.37
Starting loop...Took 131.183 ms
Output for 5.4.36
Starting loop...Took 122.267 ms
Output for 5.4.35
Starting loop...Took 97.109 ms
Output for 5.4.34
Starting loop...Took 97.523 ms
Output for 5.4.32
Starting loop...Took 97.454 ms
Output for 5.4.31
Starting loop...Took 94.611 ms
Output for 5.4.30
Starting loop...Took 99.153 ms
Output for 5.4.29
Starting loop...Took 94.478 ms
Output for 5.4.28
Starting loop...Took 98.728 ms
Output for 5.4.27
Starting loop...Took 95.730 ms
Output for 5.4.26
Starting loop...Took 94.368 ms
Output for 5.4.25
Starting loop...Took 115.442 ms
Output for 5.4.24
Starting loop...Took 121.896 ms
Output for 5.4.23
Starting loop...Took 100.667 ms
Output for 5.4.22
Starting loop...Took 98.336 ms
Output for 5.4.21
Starting loop...Took 118.630 ms
Output for 5.4.20
Starting loop...Took 118.010 ms
Output for 5.4.19
Starting loop...Took 121.300 ms
Output for 5.4.18
Starting loop...Took 114.689 ms
Output for 5.4.17
Starting loop...Took 104.231 ms
Output for 5.4.16
Starting loop...Took 116.135 ms
Output for 5.4.15
Starting loop...Took 109.198 ms
Output for 5.4.14
Starting loop...Took 113.450 ms
Output for 5.4.13
Starting loop...Took 98.760 ms
Output for 5.4.12
Starting loop...Took 111.123 ms
Output for 5.4.11
Starting loop...Took 107.538 ms
Output for 5.4.10
Starting loop...Took 148.088 ms
Output for 5.4.9
Starting loop...Took 108.532 ms
Output for 5.4.8
Starting loop...Took 124.246 ms
Output for 5.4.7
Starting loop...Took 101.354 ms
Output for 5.4.6
Starting loop...Took 120.348 ms
Output for 5.4.5
Starting loop...Took 97.345 ms
Output for 5.4.4
Starting loop...Took 133.143 ms
Output for 5.4.3
Starting loop...Took 117.076 ms
Output for 5.4.2
Starting loop...Took 125.145 ms
Output for 5.4.1
Starting loop...Took 113.608 ms
Output for 5.4.0
Starting loop...Took 104.669 ms
Output for 5.0.0 - 5.3.29
Fatal error: Call to undefined method ReflectionMethod::getClosure() in /in/TLp3J on line 9
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/TLp3J on line 3
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/TLp3J on line 3
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/TLp3J on line 3
Process exited with code 255.