>> Programmable hashes of objects should be external to the object anyway >> because eventually someone wants to store the same object in a >> different way in two different structures. > > That is the requirement that no language I can think of implements - > Java, Python, Ruby, C# all have programmatic hash method, and none of > them changes it for different structures.
C++ commonly does this. You pass a "hash function" as a template or constructor argument and use that for the structure. Additionally, this allows you to easily support types that don't natively provide internal hashing functions (such as objects from a third party library). In this case, doing it like Java, C# et al is an example of most languages getting it wrong, not them getting it right. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php