3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Name; function Boo() { var_dump('func:', __FUNCTION__, __METHOD__); } trait Constants { public static function traitC () { return __METHOD__; } } class Foo { use Constants; public static function method () { return new function () {};} } Boo(); $ref = new \ReflectionFunction(Foo::method()); var_dump($ref->export());
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected 'function' (T_FUNCTION) in /in/41dZg on line 13
Process exited with code 255.
Output for 5.3.0 - 5.3.28
Parse error: syntax error, unexpected T_STRING in /in/41dZg on line 7
Process exited with code 255.

preferences:
201.31 ms | 1395 KiB | 67 Q