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."
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);
--
View this message in context:
http://www.nabble.com/is-this-a-design-bug--tp18021962p18022066.html
Sent from the Zend Framework mailing list archive at Nabble.com.