Stanislav Malyshev wrote:
RL>>I don't understand why using the object as an index would trigger a
RL>>__toString() call. PHP's array indices are not defined to be strings,
RL>>so I don't see this as being a string context use and thus
RL>>__toString() shouldn't be called.
If so, what should be the actual key in the hash?
I am sure we could come up with some sort of hashing mechanism that
would uniquely identify an object. And perhaps even expose it to the
user with a __hashOf(). But again, I am not sure we want to open up
that can of worms. Like I said, I think this is the more correct
approach and that we shouldn't try to use a magic __toString() call here
to attempt to emulate this.
-Rasmus
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php