Re: bug or feature?
| From: | Zeev Suraski | Date: | Mon, 21 May 2001 15:30:40 +0000 |
| Subject: | Re: bug or feature? | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-56066@lists.php.net to get a copy of this message | ||
There's nothing special about $this, and thus, it can be quite a headache to have to implement something that does special things by just assigning to this variable.
Let's put it this way, knowing what I know about the engine's implementation, I have very good reasons to say that this is a side effect, that won't be very easy to implement under other implementations, definitely not in a performance efficient way (and I'm not talking about degraded performance with $this assignment, but rather, all assignments, i.e., out of the question).
It's good that this question was asked, but really, be prepared to the fact that 'no' can also be an answer.
Zeev
At 20:26 21/5/2001, Kristian Köhntopp wrote:
Stig Sæther Bakken wrote: I disagree with your conclusion here. If a side-effect is useful enough and people want to use it, why not document it de-bastardize it? The fact that other OO languages implement this should be a hint that it shouldn't be impossible to do in a different OO model. Also, this is not performance critical. It is usually done in errors handlers in constructors, so PHP engine implementors should be able to emulate it, even if assignments to $this are not a natural side effect in their implementation of a PHP engine. Kristian -- Kristian Köhntopp, NetUSE AG Dr.-Hell-Straße, D-24107 Kiel Tel: +49 431 386 435 00, Fax: +49 431 386 435 99-- Zeev Suraski <zeev@zend.com> CTO & co-founder, Zend Technologies Ltd. http://www.zend.com/