3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php namespace Name; function Boo() { var_dump('func:', __FUNCTION__, __METHOD__); } trait Constants { public static function traitC () {var_dump('trait_method:', __FUNCTION__, __METHOD__);call_user_func(function () { var_dump('trait_closure:', __FUNCTION__, __METHOD__); }); } } class Foo { use Constants public static function method () {var_dump('method:', __FUNCTION__, __METHOD__);call_user_func(function () { var_dump('closure:', __FUNCTION__, __METHOD__); }); } } Boo(); Foo::method(); Foo::traitC(); var_dump(__METHOD__);
Output for 5.4.0 - 5.4.30
Parse error: syntax error, unexpected 'public' (T_PUBLIC), expecting ',' or ';' or '{' in /in/KuDlP 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/KuDlP on line 7
Process exited with code 255.