3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php class x { function foo() { print "foo"; } function bar() { $x = array(get_class(), "self::foo"); call_user_func($x); } } $a = new x; $a->bar();
based on CfFch
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
foo
Output for hhvm-3.10.0 - 3.12.0
Warning: behavior of call_user_func(array('x', 'self::foo')) is undefined in /in/k6KTB on line 8 foo
Output for 5.1.3 - 5.2.17
Strict Standards: Non-static method x::foo() cannot be called statically, assuming $this from compatible context x in /in/k6KTB on line 8 foo
Output for 5.1.2
Strict Standards: Non-static method x::self::foo() cannot be called statically, assuming $this from compatible context x in /in/k6KTB on line 8 foo
Output for 5.0.0 - 5.1.1
Warning: call_user_func(x::self::foo): First argument is expected to be a valid callback in /in/k6KTB on line 8
Output for 4.3.2 - 4.4.9
Warning: Wrong parameter count for get_class() in /in/k6KTB on line 7 Warning: call_user_func(Array): First argument is expected to be a valid callback in /in/k6KTB on line 8
Output for 4.3.0 - 4.3.1
Warning: Wrong parameter count for get_class() in /in/k6KTB on line 7 Warning: call_user_func(Array) [http://www.php.net/function.call-user-func]: First argument is expected to be a valid callback in /in/k6KTB on line 8