class FatherClass
{
private $salary = 10;
public function showInfo()
{
echo $this->phone . '<br/>';
// why this result is 10
// why the result is not 20000
echo $this->salary . '<br/>';
}
}
class ChildClass extends FatherClass
{
protected $phone = '13987654321';
private $salary = 20000;
}
$child = new ChildClass();
$child->showInfo();
echo '<pre>';
print_r($child);
the question of 'private':
why this result is 10
why the result is not 20000
Thanks for your help