On 2014-09-23 10:04, Nicolai Scheer wrote:
> Hi all,
> 
> until 5 minutes ago I thought it would be perfectly legal to use an object
> as an array key, given that its __toString() method is in place.
> 
> Seems as if I was wrong.
> I know that array keys are not what is considered "string context"
> internally, at least not directly.
> 
> Would it harm in any way to add that feature?

Yes, it was removed intentionally (quite a long time ago), like using
resources as array keys, to avoid hard-to-trace bugs for the user. At
least that's the reasoning I can remember.


-- 
Regards,
Mike

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

Reply via email to