php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #19859 __call() does not catch call_user_func_array() calls
Submitted: 2002-10-11 05:33 UTC Modified: 2003-07-03 04:23 UTC
From: tater at potatoe dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.0-dev OS: All
Private report: No CVE-ID:
 [2002-10-11 05:33 UTC] tater at potatoe dot com
If an undefined class method is called via call_user_func_array(), the ZE2 __call() handler won't catch it.

class test
{
  function __call($method,$args)
  {
    print "test::__call invoked for method '$method'\n";
  }
}
$x = new test;
$x->fake(1);
call_user_func_array(array($x,'fake'),array(1));

Output:
test::__call invoked for method 'fake'
Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, 'test::fake' was given in /usr/local/book/book/catalog/classes/bug.php on line 11

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-07-03 04:23 UTC] stas@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.

fixed
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Thu Apr 24 02:02:10 2014 UTC