On Fri, Jul 31, 2015 at 4:53 PM, Nicolas Grekas <
nicolas.grekas+...@gmail.com> wrote:

>
> I also know people that print_r($an_object) and parse the output just to
>> extract the object handle from there... Crazy isn't it ?
>>
>
> I plead guilty for doing this, but php let me no better choice for now ;)
>
> The attached patch removes the XOR hashing for the object handle (it's
> useless, the "secret" is trivially guessed after parsing the output of
> var_dump).
>
> It would be awesome if this patch could be applied for php 7.0!
>
> Cheers,
> Nicolas
> <http://marc.info/?l=php-internals&m=141811755908008&w=2>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php


I'd prefer to add a separate function spl_object_id, which directly returns
the handle. This should supersede spl_object_hash in the long run.
spl_object_hash does a bunch of pointless things that serve no purpose
other than making the function slower and making the result more bulky.

Nikita

Reply via email to