ID: 47294 Updated by: j...@php.net Reported By: dmsuperman at gmail dot com -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Linux Ubuntu PHP Version: 5.2.8 New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2009-02-03 19:03:38] dmsuperman at gmail dot com Description: ------------ Class inheritence isn't consistent. The attach code basically explains it all. Why would it choose to use the child class in the first case, but the parent class in the second? This seems wrong to me, like it's deciding when to use one over the other which makes for a confusing programming environment. Reproduce code: --------------- <?PHP class blah { public $test = "A"; public function __construct(){ echo($this->test); } } class tacos extends blah { public $test = "B"; } $tacos = new tacos(); //Output: B //Expected output: B class P { public function __construct() { $this->fun(); } private function fun() { echo 'funny'; } } class C extends P { public function fun(){ echo "oranges"; } }; $var = new C(); //Output: funny //Expected output: oranges ?> Expected result: ---------------- Boranges Actual result: -------------- Bfunny ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47294&edit=1