#41961 [NEW]: Search for overridden private methods strays from class hierarchy
| From: | robin_fernandes at uk dot ibm dot com | Date: | Wed, 11 Jul 2007 13:01:50 +0000 |
| Subject: | #41961 [NEW]: Search for overridden private methods strays from class hierarchy | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-114896@lists.php.net to get a copy of this message | ||
From: robin_fernandes at uk dot ibm dot com
Operating system: Linux
PHP version: 5CVS-2007-07-11 (snap)
PHP Bug Type: Scripting Engine problem
Bug description: Search for overridden private methods strays from class hierarchy
Description:
------------
The wrong method is invoked if the following conditions are met:
1. A class has a public method that overrides/hides private method from
its parent.
2. An unrelated class has a public method of the same name.
3. The overriding method is invoked from within the unrelated class.
The unrelated class's method will be called instead of the overriding
method. See the testcase below for an example.
Reproduce code:
---------------
The testcase is over 20 lines, but can be found here:
http://www.nomorepasting.com/getpaste.php?pasteid=1270
Expected result:
----------------
Called public ChildClass::secret() on an instance of: ChildClass
Actual result:
--------------
Called private X::secret() on an instance of: ChildClass
--
Edit bug report at http://bugs.php.net/?id=41961&edit=1
--
Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41961&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41961&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41961&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=41961&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=41961&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=41961&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=41961&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=41961&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=41961&r=support
Expected behavior: http://bugs.php.net/fix.php?id=41961&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=41961&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=41961&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=41961&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41961&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=41961&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=41961&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=41961&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=41961&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=41961&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=41961&r=mysqlcfg