Re: [CFV] how to mark protected items?
| From: | Michael Wallner | Date: | Wed, 16 Jun 2004 10:28:37 +0000 |
| Subject: | Re: [CFV] how to mark protected items? | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-30745@lists.php.net to get a copy of this message | ||
I wrote:
> Why do people think that protected has more to do with private than public?
Perhaps someone finds this usefull:
===###===
class My
{
private $pri = "private\n";
protected $pro = "protected\n";
public $pub = "public\n";
public function out()
{
echo $this->pri, $this->pro, $this->pub;
}
}
class MyEx extends My
{
private $pri = "Uh-Oh!\n";
public $pro = "public\n";
function outEx()
{
echo $this->pri, $this->pro, $this->pub;
}
}
$my = new MyEx;
$my->out();
$my->outEx();
===###===
Regards,
--
Michael - < mike(@)php.net >
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc