Php5 extending classes and access private variables.
I have a classs.
Why don't I get access to $varName from the parent object? I am extending a class I should have access to all private variables because it's an extension of the class. If I make it public it works fine....
<php?
class BaseClass{
private $varName = array();
function BaseClass(){
// not doing anything.
}
}
?>
<php?
class MyClass extends BaseClass{
function BaseClass(){
print '<pre>';
var_dump($this->varName);
print '</pre>';
}
}
?>
Why don't I get access to $varName from the parent object? I am extending a class I should have access to all private variables because it's an extension of the class. If I make it public it works fine....
