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(array()); } echo "Took ", number_format((microtime(true)-$start)*1e3, 3), " ms";
Output for 7.1.0
Starting loop...Took 61.450 ms
Output for 7.0.14
Starting loop...Took 76.219 ms
Output for 7.0.12
Starting loop...Took 76.624 ms
Output for 7.0.6
Starting loop...Took 59.287 ms
Output for 7.0.5
Starting loop...Took 51.111 ms
Output for 7.0.4
Starting loop...Took 49.490 ms
Output for 7.0.3
Starting loop...Took 52.515 ms
Output for 7.0.2
Starting loop...Took 53.818 ms
Output for 7.0.1
Starting loop...Took 48.179 ms
Output for 7.0.0
Starting loop...Took 63.994 ms
Output for 5.6.28
Starting loop...Took 141.738 ms
Output for 5.6.21
Starting loop...Took 159.317 ms
Output for 5.6.20
Starting loop...Took 162.263 ms
Output for 5.6.19
Starting loop...Took 110.122 ms
Output for 5.6.18
Starting loop...Took 105.656 ms
Output for 5.6.17
Starting loop...Took 164.965 ms
Output for 5.6.16
Starting loop...Took 180.247 ms
Output for 5.6.15
Starting loop...Took 165.716 ms
Output for 5.6.14
Starting loop...Took 183.466 ms
Output for 5.6.13
Starting loop...Took 164.637 ms
Output for 5.6.12
Starting loop...Took 167.020 ms
Output for 5.6.11
Starting loop...Took 178.050 ms
Output for 5.6.10
Starting loop...Took 191.981 ms
Output for 5.6.9
Starting loop...Took 172.011 ms
Output for 5.6.8
Starting loop...Took 163.154 ms
Output for 5.6.7
Starting loop...Took 182.232 ms
Output for 5.5.35
Starting loop...Took 179.325 ms
Output for 5.5.34
Starting loop...Took 190.760 ms
Output for 5.5.33
Starting loop...Took 132.960 ms
Output for 5.5.32
Starting loop...Took 110.967 ms
Output for 5.5.31
Starting loop...Took 157.399 ms
Output for 5.5.30
Starting loop...Took 173.495 ms
Output for 5.5.29
Starting loop...Took 172.326 ms
Output for 5.5.28
Starting loop...Took 178.883 ms
Output for 5.5.27
Starting loop...Took 160.459 ms
Output for 5.5.26
Starting loop...Took 185.267 ms
Output for 5.5.25
Starting loop...Took 184.156 ms
Output for 5.5.24
Starting loop...Took 190.814 ms
Output for 5.4.45
Starting loop...Took 129.912 ms
Output for 5.4.44
Starting loop...Took 124.052 ms
Output for 5.4.43
Starting loop...Took 126.269 ms
Output for 5.4.42
Starting loop...Took 103.075 ms
Output for 5.4.41
Starting loop...Took 157.499 ms
Output for 5.4.40
Starting loop...Took 127.843 ms
Output for 5.4.39
Starting loop...Took 120.940 ms
Output for 5.4.38
Starting loop...Took 110.711 ms
Output for 5.4.37
Starting loop...Took 117.029 ms
Output for 5.4.36
Starting loop...Took 119.546 ms
Output for 5.4.35
Starting loop...Took 132.271 ms
Output for 5.4.34
Starting loop...Took 117.566 ms
Output for 5.4.32
Starting loop...Took 125.089 ms
Output for 5.4.31
Starting loop...Took 128.547 ms
Output for 5.4.30
Starting loop...Took 121.406 ms
Output for 5.4.29
Starting loop...Took 118.443 ms
Output for 5.4.28
Starting loop...Took 105.277 ms
Output for 5.4.27
Starting loop...Took 122.115 ms
Output for 5.4.26
Starting loop...Took 101.384 ms
Output for 5.4.25
Starting loop...Took 127.951 ms
Output for 5.4.24
Starting loop...Took 126.379 ms
Output for 5.4.23
Starting loop...Took 118.232 ms
Output for 5.4.22
Starting loop...Took 119.336 ms
Output for 5.4.21
Starting loop...Took 116.843 ms
Output for 5.4.20
Starting loop...Took 104.942 ms
Output for 5.4.19
Starting loop...Took 129.043 ms
Output for 5.4.18
Starting loop...Took 97.888 ms
Output for 5.4.17
Starting loop...Took 106.425 ms
Output for 5.4.16
Starting loop...Took 126.971 ms
Output for 5.4.15
Starting loop...Took 128.175 ms
Output for 5.4.14
Starting loop...Took 117.248 ms
Output for 5.4.13
Starting loop...Took 128.546 ms
Output for 5.4.12
Starting loop...Took 148.998 ms
Output for 5.4.11
Starting loop...Took 131.771 ms
Output for 5.4.10
Starting loop...Took 146.594 ms
Output for 5.4.9
Starting loop...Took 151.770 ms
Output for 5.4.8
Starting loop...Took 139.456 ms
Output for 5.4.7
Starting loop...Took 104.062 ms
Output for 5.4.6
Starting loop...Took 122.034 ms
Output for 5.4.5
Starting loop...Took 105.210 ms
Output for 5.4.4
Starting loop...Took 102.165 ms
Output for 5.4.3
Starting loop...Took 118.269 ms
Output for 5.4.2
Starting loop...Took 127.958 ms
Output for 5.4.1
Starting loop...Took 146.800 ms
Output for 5.4.0
Starting loop...Took 156.335 ms
Output for 5.0.0 - 5.3.29
Fatal error: Call to undefined method ReflectionMethod::getClosure() in /in/MV5kW 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/MV5kW 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/MV5kW 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/MV5kW on line 3
Process exited with code 255.