|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-07-20 14:05 UTC] felipe@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 12:00:01 2025 UTC |
Description: ------------ If you call an instantiated object's private/protected method's via call_user_func_array(array($objFoo, 'bar'), $arrParams) the error message regarding why the method is not callable is too generic. It implies the function does not exist. Please note: This is NOT a bug in the code, but rather a error message that could definitely be more helpful, which is why it's filed under documentation. Reproduce code: --------------- <?php class A { private function Foo() { return 'Foo!'; } } $objA = new A(); call_user_func_array(array($objA, 'Foo'), array()); ?> Expected result: ---------------- Fatal error: Call to private method A::Foo() from context '' in on line 10 Actual result: -------------- Warning: call_user_func_array(): First argument is expected to be a valid callback, 'A::Foo' was given in on line 10