On 02/08/2015 18:41, Bob Weinand wrote:
Some suspicious use of spl_object_hash() out there...
>
>>https://github.com/symfony/symfony/blob/master/src/Symfony/Component/VarDumper/Cloner/VarCloner.php
>
>Not sure what this one does... but calculations with spl_object_hash()
>look very suspicious.
Actually, it's doing the right thing… calculating the value the object id is
xor'ed with (as we know that consecutively defined objects have consecutive
ids).
It's relying on the implementation of spl_object_hash() and will even continue
to work when we remove that part of randomness as that value it's xor'ed with
is then nothing else than 0.
The right thing for what purpose? Why does it need that ID, rather than
the value that spl_object_hash() gave in the first place? Just to be
prettier to the user?
Regards,
--
Rowan Collins
[IMSoP]
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php