Re: Fwd: Re: [PHP] Private and protected variables in PHP 5?
| From: | Paul Hudson | Date: | Sat, 12 Jul 2003 16:38:06 +0000 |
| Subject: | Re: Fwd: Re: [PHP] Private and protected variables in PHP 5? | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-3390@lists.php.net to get a copy of this message | ||
Andi,
> However, if you inherit from this class the new class does not know any of
> the parents' private members and therefore doesn't error out. This is the
> correct way of handling it because private members should be hidden to
> inheriting classes.
When you say "hidden", do you mean that it still exists? That is, in the code
example there's a private $Name for the dog class, and I set a new $Name in
the code. Would that mean there was a private $Name and a public $Name? If
so, I imagine that all functions that had access to the private $Name would
use it, and all functions that didn't have access would use the public $Name.
Sounds kinda confusing! Is this correct?
--Paul