Re: Re: spl_object_hash not hashing unqiue objects BUG

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Thank you, I am now understanding this much better.

Could you explain this though, if my understanding is correct the same
hash is used if the object no longer exists in memory.

In that case the following should all have the same hash, but they
don't see output.

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/>';
class a4 {}
$obi = new a4();
echo get_class($obi).': '.spl_object_hash($obi).'<br/>';
class a5 {}
$obi = new a5();
echo get_class($obi).': '.spl_object_hash($obi).'<br/>';

Outputs:
a1: 09d264fcececf51c822c9382b40e3edf
a2: 45701af64172cbc2a33069dfed73fd07
a3: 09d264fcececf51c822c9382b40e3edf
a4: 45701af64172cbc2a33069dfed73fd07
a5: 09d264fcececf51c822c9382b40e3edf

2009/2/12 Jochem Maas <jochem@xxxxxxxxxxxxx>:
> Colin Guthrie schreef:
>> 'Twas brillig, and Jochem Maas at 12/02/09 12:47 did gyre and gimble:
>>> Colin Guthrie schreef:
>>>> 'Twas brillig, and Nick Cooper at 12/02/09 11:38 did gyre and gimble:
>>>>> Outputs:
>>>>>
>>>>> a1: 09d264fcececf51c822c9382b40e3edf
>>>>> a2: 45701af64172cbc2a33069dfed73fd07
>>>>> a3: 09d264fcececf51c822c9382b40e3edf
>>>>> a4: 09d264fcececf51c822c9382b40e3edf
>>>>>
>>>>> Thanks let me know how I should proceed with this.
>>>> Confirmed here. I get different hashes, but the same pattern:
>>>>
>>>> a1: 79eff28a9757f1a526882d82fe01d0f3
>>>> a2: 4cec55f17563fe4436164f438de7a88c
>>>> a3: 79eff28a9757f1a526882d82fe01d0f3
>>>> a4: 79eff28a9757f1a526882d82fe01d0f3
>>>>
>>>> PHP 5.2.9RC1 with Suhosin-Patch 0.9.6.3 (cli) (built: Feb  9 2009
>>>> 16:00:42)
>>>> Copyright (c) 1997-2009 The PHP Group
>>>> Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies
>>>>
>>>> You should report the bug:
>>>> http://bugs.php.net/
>>>
>>> it's not a bug. RTFM
>>
>> Yup I meant to retract my statement after reading your reply but my
>> message hadn't come through yet to the list and I then got distracted by
>> something or other.
>
> ah. that could have been me :-)
>
>>
>> In fairness tho' I did RTFM for the function itself and the stuff you
>> quoted wasn't listed there, so the docu could do with a little
>> clarification on that point.
>
> granted. the user notes contain the relevant info, the actual docs do indeed lack
> detail. Quite a bit of detail regarding this issue actually cropped up on
> the internals mailinglist which is where I picked up on it.
>
> --
> does a bear shit in the woods? is G.W.Bush a socialist?
> (given that all the gun-toting Bush supporters have killed all
> the bears that rhetoric may actually make sense)
>
>> Col
>>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Nick Cooper
JDI Solutions
www.jdi-solutions.co.uk

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux