Re: Inconsistencies when accessing protected members

From: Date: Wed, 26 Mar 2008 20:04:50 +0000
Subject: Re: Inconsistencies when accessing protected members
References: 1 2 3 4 5 6  Groups: php.internals 
Request: Send a blank email to internals+get-36563@lists.php.net to get a copy of this message
This still will works.
Surely it shouldn't work at all unless the $foo === $this?
Why not? If the context is right, why shouldn't it be able to call this content's protected functions? As I understand, protected funciton means no code outside the class can call it, since it's not a part of the public API. However, here we have clear case of code *inside* the class, so what's the problem with calling it? -- Stanislav Malyshev, Zend Software Architect stas@zend.com http://www.zend.com/ (408)253-8829 MSN: stas@zend.com

« previous php.internals (#36563) next »