-- ctx2002 <[EMAIL PROTECTED]> wrote
(on Thursday, 19 June 2008, 07:55 PM -0700):
> sorry , accidentally submitted previous post without write any thing.
>
> i am use 1.5.1 version of zend framework.
> my problem is , many zend class use __get, __call magic function , and have
> set those functions as protected function. but according to PHP doc,
>
> "All overloading methods must be defined as public."
These have all been updated in current trunk to visibility public in the
past two weeks; you will see the changes in an upcoming release.
> Although , PHP itself can call protected function directly (i do not know
> why, PHP internal violate data hidding principal ).
>
> but some programs may assume all magic functions are public function.
>
> for example: i am use PHPTal template engine, and the engine will call
> is_callable() function to see if
> given function can be called or not. this is lead to a problem, since many
> zend classes set magic function to be protected function, that caused PHPTal
> engine can not access those magic functions.
>
>
> here is a example that PHP violate data hidding principal.
>
> class Test
> {
> protected function __get($name)
> {
> return $name;
> }
> }
>
> $obj = new Test();
> $b = is_callable($obj,"__get");
>
> //this should throw a error.
> echo $obj->hello . "\n";
> var_dump($b);
--
Matthew Weier O'Phinney
Software Architect | [EMAIL PROTECTED]
Zend Framework | http://framework.zend.com/