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.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php