From:             vivekanandan8 at yahoo dot com
Operating system: debian linux 
PHP version:      5.2CVS-2009-01-20 (snap)
PHP Bug Type:     Class/Object related
Bug description:  needs seperate copy of member variable irrespictive access 
modifier changes.

Description:
------------
i am using php 5.2.6 in debian linux platform.Having common  member
variables names in classes used in inheritance still has problem.
when we declare as private for both member variable it works fine 
but when we declare parent member variable as public , it throws error

Expected result:
  needs seperate copy of the member variable as the same behaviour as both
are private.
Actual Result:
 Access level to son::$mName must be public (as in class dad) i
 


vivek

Reproduce code:
---------------
<?
class dad { 
public $mName;     
function setDADName(){
        $this->mName='father'; 
}
}
    
class son extends dad {  
private $mName; 
function setSONName(){
        $this->mName='child'; 
}
}
  $oChildObj = new son;  
$oChildObj->setDADName(); 
$oChildObj->setSONName(); 
?>

Expected result:
----------------
both call to same member variable successfully assign  value to $mName
same as when they are private in both clases(dad,son).

Actual result:
--------------
Access level to son::$mName must be public (as in class dad) 

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

Reply via email to