spl_object_hash not hashing unqiue objects BUG
| From: | Nick Cooper | Date: | Thu, 12 Feb 2009 11:38:26 +0000 |
| Subject: | spl_object_hash not hashing unqiue objects BUG | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-288150@lists.php.net to get a copy of this message | ||
I am having a problem with spl_object_hash() creating non unique hashes.
I understand with MD5 it is possible to have the same hash for
different strings but this doesn't seem like that problem.
I have created a simple test below, should I report this as a bug or
am I doing something wrong.
PHP 5.2.8 (extensions all disabled)
Win XP SP3
Apache 2.2.11
<?php
class a1 {}
$obi = new a1();
echo get_class($obi).': '.spl_object_hash($obi).'<br/>';
class a2 {}
$obi = new a2();
echo get_class($obi).': '.spl_object_hash($obi).'<br/>';
class a3 {}
$obi = new a3();
echo get_class($obi).': '.spl_object_hash($obi).'<br/>';
unset($obi);
class a4 {}
$obi = new a4();
echo get_class($obi).': '.spl_object_hash($obi).'<br/>';
?>
Outputs:
a1: 09d264fcececf51c822c9382b40e3edf
a2: 45701af64172cbc2a33069dfed73fd07
a3: 09d264fcececf51c822c9382b40e3edf
a4: 09d264fcececf51c822c9382b40e3edf
Thanks let me know how I should proceed with this.