Re: wacky object idea

From: Date: Mon, 28 Aug 2000 15:11:16 +0000
Subject: Re: wacky object idea
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.dev 
Request: Send a blank email to php-dev+get-30970@lists.php.net to get a copy of this message
At 11:02 28/08/00 -0400, Chuck Hagenbuch wrote:
Quoting Andi Gutmans <andi@zend.com>: I think this would cause lots of confusion. PHP types aren't always that obvious and you'll probably get lots of unexpected results. Not sure things will work as consistently as you guys expect. Can you elaborate on this at all? My idea is that if you specifically define a function inside your class (following current convention, it'd be __boolean_value), then whenever you needed to evaluate that object in a boolean context, you'd use the result of that function. Seems like it shouldn't confuse people, since it would only change current behavior if you actually went ahead and changed your code to define __boolean_value...
Yeah but not only would this mean changing lots and lots of the Zend Engine it is not trivial that this will work nicely in all cases. We have to think of all the possible contexts we would expect this to work (I'm sure there are not trivial ones) and then see what happens. Andi --- Andi Gutmans <andi@zend.com> http://www.zend.com/

« previous php.dev (#30970) next »