3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class A { public function x() { return 'x'; } } $a = new A(); var_dump( call_user_func([$a, 'x']), call_user_func([$a, 'y']) );
Output for 5.6.0 - 5.6.38, 7.0.0 - 7.2.11
Warning: call_user_func() expects parameter 1 to be a valid callback, class 'A' does not have a method 'y' in /in/guDVU on line 13 string(1) "x" NULL
Output for hhvm-3.22.0
Warning: Invalid argument: function: method 'y' not found in /in/guDVU on line -1 string(1) "x" NULL
Output for hhvm-3.15.4 - 3.21.3
Warning: Invalid argument: function: method 'y' not found in /in/guDVU on line 13 string(1) "x" NULL