#47801 [Opn->Csd]: __call() accessed via parent:: operator is provided incorrect method name
| From: | felipe@php.net | Date: | Wed, 08 Apr 2009 02:05:43 +0000 |
| Subject: | #47801 [Opn->Csd]: __call() accessed via parent:: operator is provided incorrect method name | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-135648@lists.php.net to get a copy of this message | ||
ID: 47801
Updated by: felipe@php.net
Reported By: kkauper at yahoo-inc dot com
-Status: Open
+Status: Closed
-Bug Type: Class/Object related
+Bug Type: Scripting Engine problem
Operating System: FreeBSD 4
PHP Version: 5.2.9
New Comment:
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
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2009-03-31 22:54:52] 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-03-31 07:23:29] jani@php.net
See also bug #42937
------------------------------------------------------------------------
[2009-03-27 03:29:40] kkauper at yahoo-inc dot com
Description:
------------
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()
{
parent::getFoo();
}
}
$a = new A();
$a->getFoo();
$b = new B();
$b->getFoo();
Expected result:
----------------
magic method called: getFoo
magic method called: getFoo
Actual result:
--------------
magic method called: getFoo
magic method called: getfoo
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=47801&edit=1