Bug #63468 [Asn->Csd]: wrong called method as callback with inheritance
| From: | dmitry@php.net | Date: | Tue, 20 Nov 2012 09:17:17 +0000 |
| Subject: | Bug #63468 [Asn->Csd]: wrong called method as callback with inheritance | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-174811@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=63468&edit=1
ID: 63468
Updated by: dmitry@php.net
Reported by: patrik at votocek dot cz
Summary: wrong called method as callback with inheritance
-Status: Assigned
+Status: Closed
Type: Bug
Package: Scripting Engine problem
Operating System: ArchLinux
PHP Version: 5.4.8
Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src.git;a=commit;h=396c1e990a0e513cf2e8510e9b6f82ab425c9e3a
Log: Fixed bug #63468 (wrong called method as callback with inheritance)
Previous Comments:
------------------------------------------------------------------------
[2012-11-08 15:05:29] laruence@php.net
dmitry, do you have time to look at this patch? thanks
------------------------------------------------------------------------
[2012-11-08 15:04:47] laruence@php.net
The following patch has been added/updated:
Patch Name: bug63468.patch
Revision: 1352387087
URL: https://bugs.php.net/patch-display.php?bug=63468&patch=bug63468.patch&revision=1352387087
------------------------------------------------------------------------
[2012-11-08 13:18:39] patrik at votocek dot cz
Description:
------------
callback call private method (in parent class) instead of public method in
current class
Test script:
---------------
<?php
class Foo
{
public function run()
{
return call_user_func(array('Bar', 'getValue'));
}
private static function getValue()
{
return 'Foo';
}
}
class Bar extends Foo
{
public static function getValue()
{
return 'Bar';
}
}
$x = new Bar;
$x->run();
Expected result:
----------------
'Bar'
Actual result:
--------------
'Foo'
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=63468&edit=1