Re: cvs: phpdoc /en/language/oop5 magic.xml overloading.xml

From: Date: Sun, 07 Aug 2005 12:33:06 +0000
Subject: Re: cvs: phpdoc /en/language/oop5 magic.xml overloading.xml
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969369507@lists.php.net to get a copy of this message
On Sun, 7 Aug 2005, Nuno Lopes wrote:
@@ -8,8 +8,13 @@
    __call, __get and __set methods. These methods will only be
    triggered when your object or inherited object doesn't contain the
    member or method you're trying to access.
- All overloading methods must be defined as - <link linkend="language.oop5.visibility">public</link>. + All overloading methods must not be defined as + <link linkend="language.oop5.visibility">static</link>.
Uh?
@@ -43,9 +56,9 @@
     public $n;
     private $x = array("a" => 1, "b" => 2, "c" => 3);
-    public function __get($nm)
+    private function __get($nm)
? They need to be public... regards, Derick
At least in latest HEAD, they don't. excerpt from zend_register_functions (Zend/zend_api.c:1421-1627): if (__get) {
    if (__get->common.fn_flags & ZEND_ACC_STATIC) {
        zend_error(error_type, "Method %s::%s() cannot be static", scope->name, __get->common.function_name);
    }
(the same is repeated for the other methods) So, it only check if the method is static or not. And IMHO, it might be a good politic to declare those methods as private or protected to avoid external abuses. Nuno

« previous php.doc (#969369507) next »