3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class a { public function ddd() { echo "dddd", "\n"; } } $d = new a(); call_user_func(array($d, 'test')); class b { private function ddd() { echo "dddd", "\n"; } } $e = new b(); call_user_func(array($e, 'test'));
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0beta1
Warning: call_user_func() expects parameter 1 to be a valid callback, class 'a' does not have a method 'test' in /in/B74Lp on line 11 Warning: call_user_func() expects parameter 1 to be a valid callback, class 'b' does not have a method 'test' in /in/B74Lp on line 21
Output for hhvm-3.22.0
Warning: Invalid argument: function: method 'test' not found in /in/B74Lp on line -1 Warning: Invalid argument: function: method 'test' not found in /in/B74Lp on line -1
Output for hhvm-3.18.5 - 3.21.3
Warning: Invalid argument: function: method 'test' not found in /in/B74Lp on line 11 Warning: Invalid argument: function: method 'test' not found in /in/B74Lp on line 21