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++) { $closure(); } echo "Took ", number_format((microtime(true)-$start)*1e3, 3), " ms";
Output for 7.1.0
Starting loop...Took 45.375 ms
Output for 7.0.14
Starting loop...Took 45.447 ms
Output for 7.0.12
Starting loop...Took 45.224 ms
Output for 7.0.6
Starting loop...Took 41.396 ms
Output for 7.0.5
Starting loop...Took 39.636 ms
Output for 7.0.4
Starting loop...Took 30.004 ms
Output for 7.0.3
Starting loop...Took 36.219 ms
Output for 7.0.2
Starting loop...Took 27.877 ms
Output for 7.0.1
Starting loop...Took 28.808 ms
Output for 7.0.0
Starting loop...Took 40.271 ms
Output for 5.6.28
Starting loop...Took 99.616 ms
Output for 5.6.21
Starting loop...Took 131.577 ms
Output for 5.6.20
Starting loop...Took 130.264 ms
Output for 5.6.19
Starting loop...Took 82.264 ms
Output for 5.6.18
Starting loop...Took 70.212 ms
Output for 5.6.17
Starting loop...Took 126.018 ms
Output for 5.6.16
Starting loop...Took 134.569 ms
Output for 5.6.15
Starting loop...Took 151.988 ms
Output for 5.6.14
Starting loop...Took 153.341 ms
Output for 5.6.13
Starting loop...Took 153.282 ms
Output for 5.6.12
Starting loop...Took 129.948 ms
Output for 5.6.11
Starting loop...Took 131.894 ms
Output for 5.6.10
Starting loop...Took 145.189 ms
Output for 5.6.9
Starting loop...Took 143.553 ms
Output for 5.6.8
Starting loop...Took 145.194 ms
Output for 5.6.7
Starting loop...Took 131.543 ms
Output for 5.5.35
Starting loop...Took 150.677 ms
Output for 5.5.34
Starting loop...Took 134.594 ms
Output for 5.5.33
Starting loop...Took 86.302 ms
Output for 5.5.32
Starting loop...Took 76.758 ms
Output for 5.5.31
Starting loop...Took 130.609 ms
Output for 5.5.30
Starting loop...Took 127.628 ms
Output for 5.5.29
Starting loop...Took 153.388 ms
Output for 5.5.28
Starting loop...Took 126.465 ms
Output for 5.5.27
Starting loop...Took 148.249 ms
Output for 5.5.26
Starting loop...Took 145.179 ms
Output for 5.5.25
Starting loop...Took 137.751 ms
Output for 5.5.24
Starting loop...Took 129.289 ms
Output for 5.4.45
Starting loop...Took 65.459 ms
Output for 5.4.44
Starting loop...Took 85.816 ms
Output for 5.4.43
Starting loop...Took 89.709 ms
Output for 5.4.42
Starting loop...Took 67.327 ms
Output for 5.4.41
Starting loop...Took 72.974 ms
Output for 5.4.40
Starting loop...Took 82.315 ms
Output for 5.4.39
Starting loop...Took 75.026 ms
Output for 5.4.38
Starting loop...Took 79.708 ms
Output for 5.4.37
Starting loop...Took 87.203 ms
Output for 5.4.36
Starting loop...Took 74.507 ms
Output for 5.4.35
Starting loop...Took 79.560 ms
Output for 5.4.34
Starting loop...Took 83.237 ms
Output for 5.4.32
Starting loop...Took 64.896 ms
Output for 5.4.31
Starting loop...Took 66.065 ms
Output for 5.4.30
Starting loop...Took 89.923 ms
Output for 5.4.29
Starting loop...Took 78.242 ms
Output for 5.4.28
Starting loop...Took 80.733 ms
Output for 5.4.27
Starting loop...Took 87.105 ms
Output for 5.4.26
Starting loop...Took 87.307 ms
Output for 5.4.25
Starting loop...Took 76.656 ms
Output for 5.4.24
Starting loop...Took 86.220 ms
Output for 5.4.23
Starting loop...Took 90.305 ms
Output for 5.4.22
Starting loop...Took 77.080 ms
Output for 5.4.21
Starting loop...Took 89.485 ms
Output for 5.4.20
Starting loop...Took 85.040 ms
Output for 5.4.19
Starting loop...Took 64.569 ms
Output for 5.4.18
Starting loop...Took 71.163 ms
Output for 5.4.17
Starting loop...Took 82.825 ms
Output for 5.4.16
Starting loop...Took 88.971 ms
Output for 5.4.15
Starting loop...Took 84.785 ms
Output for 5.4.14
Starting loop...Took 65.727 ms
Output for 5.4.13
Starting loop...Took 70.729 ms
Output for 5.4.12
Starting loop...Took 76.114 ms
Output for 5.4.11
Starting loop...Took 86.561 ms
Output for 5.4.10
Starting loop...Took 86.033 ms
Output for 5.4.9
Starting loop...Took 74.199 ms
Output for 5.4.8
Starting loop...Took 90.371 ms
Output for 5.4.7
Starting loop...Took 66.438 ms
Output for 5.4.6
Starting loop...Took 72.086 ms
Output for 5.4.5
Starting loop...Took 75.196 ms
Output for 5.4.4
Starting loop...Took 67.541 ms
Output for 5.4.3
Starting loop...Took 64.256 ms
Output for 5.4.2
Starting loop...Took 63.504 ms
Output for 5.4.1
Starting loop...Took 71.447 ms
Output for 5.4.0
Starting loop...Took 78.746 ms
Output for 5.0.0 - 5.3.29
Fatal error: Call to undefined method ReflectionMethod::getClosure() in /in/DdXVs 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/DdXVs 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/DdXVs 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/DdXVs on line 3
Process exited with code 255.