php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63468 wrong called method as callback with inheritance
Submitted: 2012-11-08 13:18 UTC Modified: 2012-11-08 15:05 UTC
From: patrik at votocek dot cz Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.4.8 OS: ArchLinux
Private report: No CVE-ID: None
 [2012-11-08 13:18 UTC] 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'

Patches

bug63468.patch (last revision 2012-11-08 15:04 UTC by laruence@php.net)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-11-08 15:04 UTC] 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 15:05 UTC] laruence@php.net
dmitry, do you have time to look at this patch? thanks
 [2012-11-08 15:05 UTC] laruence@php.net
-Assigned To: +Assigned To: dmitry
 [2012-11-20 09:17 UTC] dmitry@php.net
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)
 [2012-11-20 09:17 UTC] dmitry@php.net
-Status: Assigned +Status: Closed
 [2014-10-07 23:21 UTC] stas@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=396c1e990a0e513cf2e8510e9b6f82ab425c9e3a
Log: Fixed bug #63468 (wrong called method as callback with inheritance)
 [2014-10-07 23:32 UTC] stas@php.net
Automatic comment on behalf of dmitry@zend.com
Revision: http://git.php.net/?p=php-src-security.git;a=commit;h=396c1e990a0e513cf2e8510e9b6f82ab425c9e3a
Log: Fixed bug #63468 (wrong called method as callback with inheritance)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Mar 19 07:01:29 2024 UTC