At 09:47 08.04.2002, you wrote:
>Andrei Zmievski wrote:
> > Please expound on this. I would like to hear specific
> > problems you see existing with __get_x() callbacks.
>
>As of now, this is just an unspecified bad feeling of mine.
>I only can back up this with the two times we had special names
>which were variable in PHP: Both attempts at them failed
>horribly:
>
>- We had (have, until ZE 2, if I am not mistaken) variable
>   named constructors (ctors named after the class). These
>had a number of design flaws in PHP 3, which were fixed in
>PHP 4, at the cost of an overly complex ruleset for
>constructor names.
>
>Had we chosen stable names for constructors, we'd gotten the
>same effect with a single rule for ctor names.
>
>- We had (until very recently) variable names for imported
>   variables amidst our global namespace. We earned a number
>of security problems due to admittedly stupid code, which
>swayed the PTBs to finally disable registering globals by
>default.
>
>I cannot come up with a bomb script right now, but I am
>reasonably sure that __get_x() will backfire at some time
>as well.
>
>Kristian

What if we would use declared properties?

<property> := property <name> = { <access_specifiers> };
<access_specifiers> := <access_specifier> [, <access_specifiers>]
<access_specifier> := <read_access> | <write_access>
<read_access> := read = <method_name> | <member_name>
<write_access> := write = <method_name> | <member_name>

class A {
         private var $_X;

         protected function set_X($newX) {
                 $this->_X = $newX;
         }

         public property X = { read = $_X, write = set_X};
}

marcus


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to