On 29 November 2014 at 00:21, Rowan Collins <rowan.coll...@gmail.com> wrote: > On 28/11/2014 01:13, Bostjan Skufca wrote: >> >> A function called spl_object_hash() exists, >> but it returns identical hashes for equal objects. > > In case it's been lost in the noise, no it doesn't.
Ouch. I am terribly sorry about this mistake, it really does not. However, having word "hash" in the function name suggests that returned hash is generated by the object's contents, too. I just noticed that the first comment explains that this is not the case, which I confirmed with additional testing. To quote a part of first sentence of Wikipedia on "Hash function": "...with slight differences in input data producing very big differences in output data." So, to sum it up: spl_object_hash indeed does what I initially required, but I was mislead by the "hash" word in its name, and the environment where I was trying to use it (unable to bring two object references in the same place easily). But I would maybe suggest changing the name to spl_object_id (and keeping ..._hash alias for backward compatibility). b. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php