Bug #63468 [Opn]: wrong called method as callback with inheritance
| From: | laruence@php.net | Date: | Thu, 08 Nov 2012 15:05:29 +0000 |
| Subject: | Bug #63468 [Opn]: wrong called method as callback with inheritance | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-174589@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: laruence@php.net
Reported by: patrik at votocek dot cz
Summary: wrong called method as callback with inheritance
Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: ArchLinux
PHP Version: 5.4.8
-Assigned To:
+Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
dmitry, do you have time to look at this patch? thanks
Previous Comments:
------------------------------------------------------------------------
[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