|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #47801 __call() accessed via parent:: operator is provided incorrect method name
Submitted: 2009-03-27 03:29 UTC Modified: 2009-04-08 02:05 UTC
From: kkauper at yahoo-inc dot com Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5.2.9 OS: FreeBSD 4
Private report: No CVE-ID: None
 [2009-03-27 03:29 UTC] kkauper at yahoo-inc dot com
If parent::<method-name> (NOTE: this is *not* a static invocation) is called in a child class, and <method-name> does not exist in the parent, the parent's __call() magic method is provided the method name (the $name argument) in lower case.

See the code provided to reproduce the problem. The $b->getFoo(); call should output the method name as "getFoo", including the upercase "F" character. Instead, the method name is converted to all lower case. To be consistent with the results of $a->getFoo();, the method name should not be converted to lower case.

This issue is probably related to the recently resolved bug # 42937.

Reproduce code:
class A
  function __call($name, $args)
    echo("magic method called: $name\n");

class B extends A
  function getFoo()

$a = new A();

$b = new B();

Expected result:
magic method called: getFoo
magic method called: getFoo 

Actual result:
magic method called: getFoo
magic method called: getfoo 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2009-03-31 07:23 UTC]
See also bug #42937
 [2009-03-31 22:54 UTC] kkauper at yahoo-inc dot com
jani@ -- I'm not sure I understand your comment. I've already mentioned bug 42937 in my problem description. This problem may be related, but is not identical.
 [2009-04-08 02:05 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Dec 01 07:01:28 2023 UTC