On Jun 4, 2006, at 8:33 PM, Michael Gall wrote:
For example, for an eBay Item object, my __toString() returns the
Title, but that's not unique, so my __toHash() returns the numeric
ID,
which is.
While I wouldn't be surprised if you completely ignore my opinion,
however I
think the __toHash implementation should happen in an interface,
rather than
happening automagically. That will make it just a little bit more
predicatable.
+1 on that from me. There is definitely a use for a __toHash() magic
function WITHOUT it being automagical. An automagical one would
probably lead to a lot of confusion and odd behaviors. Let people use
the feature if they need it and ignore it otherwise.
However, if it was automagical, I'd agree with previous comments:
Make it a string based on the hash table pointer.
Gwynne
SkyTag Software
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php