From:             bholbrook at servillian dot com
Operating system: Linux Cent OS
PHP version:      5.2.5
PHP Bug Type:     Scripting Engine problem
Bug description:  Inproper use of extending class method from extended class.

Description:
------------
In the example, class A gains a knowledge of it's extending classes
functions. By allowing the call from the entended class to an extending
class method, the extended class method becomes unavailable to any other
extending class.

The only time this makes sense is if class A were an abstract class and
defined method3 as an abstract function.

Reproduce code:
---------------
<?php
class A {
        public function method1(){
                echo "I am method A::method1<br/>";
                $this->method3();
        }
}
class B extends A{
        public function method2(){
                echo "I am method B::method2<br/>";
                $this->method1();
        }
        public function method3(){
                echo "I am method B::method3<br/>";
        }
}
class C extends A{
        public function method4(){
                echo "I am method C::method4<br/>";
                $this->method1();
        }
}
$oB = new B();
$oB->method2();
$oC = new C();
$oC->method4();
?>

Expected result:
----------------
The expected result of $oB->method2(); is the current results of
$oC->method4();

Actual result:
--------------
Currently, $oB->method2() calls A::method1() (correct) which in turn calls
B::method3() (incorrect).

-- 
Edit bug report at http://bugs.php.net/?id=43499&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=43499&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=43499&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=43499&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=43499&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=43499&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=43499&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=43499&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=43499&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=43499&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=43499&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=43499&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=43499&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=43499&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=43499&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=43499&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=43499&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=43499&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=43499&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=43499&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=43499&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=43499&r=mysqlcfg

Reply via email to