ID:               26299
 Updated by:       [EMAIL PROTECTED]
 Reported By:      forseti at oak dot rpg dot pl
-Status:           Open
+Status:           Bogus
 Bug Type:         Zend Engine 2 problem
 Operating System: Windows 98 SE
 PHP Version:      5.0.0b2 (beta2)
 New Comment:

This is expected. When a member is private, it can only be 
seen by the class it is a member of. Class B has no idea 
class A also has a member called $a and goes ahead and 
creates one. It's just a matter of visibility. 
 
J 


Previous Comments:
------------------------------------------------------------------------

[2003-11-18 10:05:05] forseti at oak dot rpg dot pl

Description:
------------
When extending a class, private member variables from parent class are
retained even if child class defines same-named variable. 

Reproduce code:
---------------
<?php 
class A {
        private $a = 'From class A';
} 

class B extends A{
        private $a = 'From class B';
}
echo '<pre>';print_r(new B);echo '</pre>';
?>

Expected result:
----------------
b Object
(
    [a:private] => From class B
)



Actual result:
--------------
b Object
(
    [a:private] => From class B
    [a:private] => From class A
)




------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=26299&edit=1

Reply via email to