Re: Missing __toString() part

From: Date: Sun, 04 Jun 2006 01:55:31 +0000
Subject: Re: Missing __toString() part
References: 1 2 3 4 5 6 7 8  Groups: php.internals 
Request: Send a blank email to internals+get-23902@lists.php.net to get a copy of this message
On Sat, 03 Jun 2006 18:50:09 -0700 rasmus@lerdorf.com (Rasmus Lerdorf) wrote: > This works today and basically gives you the same thing. The only > thing it doesn't do is separate an array index context from an output > context allowing you do different things in the two cases. > > I think if we are going to add a toHash thing, it should trigger when > the object is used in a hash context, just like toString triggers > when it is used in a string context. Agreed. this is the only solution to limit undesired behaviors, if we add such magic method. As well as raising warnings when an object is used as hash without having this method defined. -- Pierre

« previous php.internals (#23902) next »