Re: Missing __toString() part
| From: | Andrei Zmievski | Date: | Sun, 04 Jun 2006 23:28:01 +0000 |
| Subject: | Re: Missing __toString() part | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-23945@lists.php.net to get a copy of this message | ||
I am sorry if I missed the whole thread. I think that using the result of __toString() for indexing objects is a bad idea. If we want to allow this behavior (which is actually useful in some situations), I'd rather we had a __hash() method or something similar to what Python does. The string representation of the object and its hashed representation may be very different.
-Andrei
On Jun 3, 2006, at 4:42 AM, Marcus Boerger wrote:
Hello guys, the attached patch closes one more __toString() part. It allows to use objects that define __toString as indexes to arrays. What do you guys think about this, should we add it or stay with the old behavior that didn't allow objects as indexes at all. --Best regards,Marcus mailto:mail@marcus-boerger.de<ze2-offset-obj-tostring-20060603.diff.txt> --PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php