Re: do_declare_property()

From: Date: Wed, 12 Jul 2000 12:36:34 +0000
Subject: Re: do_declare_property()
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-24292@lists.php.net to get a copy of this message
On Wed, 12 Jul 2000, Teodor Cimpoesu wrote: > Hi Zeev! > On Wed, 12 Jul 2000, Zeev Suraski wrote: > > > A good start would be knowing how you implemented these access control > > modifiers. As far as I can tell there's no real transparent way of doing > > this without either slowing Zend down considerably, or consuming roughly 2x > > memory (even if you don't use objects). > > > BTW, in Python, the trick is a rewrite of the variable names. > The convention is that private members to start with (least) 2 `__' : > e.g. > class Foo: > def __init__(self,b): > self.__bar = b > def getBar(self): > return self.__bar > z = Foo(1) > print z.getBar() > > for the private variable __bar, Python rewrites it to _Foo__bar Well its working, costing (only) ~0.01 sec extra on my Celly 366 - 32M (sigh:-)) But ehm.. I think its kinda ugly:) Anyone else got any thoughts on this?? > > -- teodor > > -- > PHP Development Mailing List <http://www.php.net/> > To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net > For additional commands, e-mail: php-dev-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.dev (#24292) next »