On Sat, 03 Jun 2006 18:50:09 -0700
[EMAIL PROTECTED] (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

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

Reply via email to