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, 'ddd')); class b { private function ddd() { echo "dddd", "\n"; } } $e = new b(); call_user_func(array($e, 'ddd'));
based on B74Lp
Output for 5.6.0 - 5.6.30, 7.0.0 - 7.3.0rc3
dddd Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access private method b::ddd() in /in/FidCJ on line 21
Output for hhvm-3.22.0
dddd Warning: Invalid argument: function: method 'ddd' not found in /in/FidCJ on line -1
Output for hhvm-3.18.5 - 3.21.3
dddd Warning: Invalid argument: function: method 'ddd' not found in /in/FidCJ on line 21