RE: [PHP-DEV] Exposing object handles to userland
| From: | Anatol Belski | Date: | Fri, 31 Jul 2015 16:07:13 +0000 |
| Subject: | RE: [PHP-DEV] Exposing object handles to userland | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-87443@lists.php.net to get a copy of this message | ||
Hi Nicolas,
Have you checked the impact of changing the existing function? Like
https://github.com/sebastianbergmann/phpunit/search?utf8=%E2%9C%93
<https://github.com/sebastianbergmann/phpunit/search?utf8=%E2%9C%93&q=spl_object_hash>
&q=spl_object_hash
https://github.com/symfony/symfony/blob/master/src/Symfony/Component/VarDumper/Cloner/VarCloner.php
https://github.com/horde/horde/blob/master/imp/lib/Factory/MimeViewer.php
https://github.com/horde/horde/blob/master/framework/Support/lib/Horde/Support/Randomid.php
https://github.com/WordPress/WordPress/blob/master/wp-includes/plugin.php
Obviously there will be more. Seems some stuff even depends on the exact output. So it would be most
likely a BC break.
Now, I’d see this more like a feature request, as Julien was mentioning another function at the
start. But IMHO opinions from people specializing on test/debug user land tools would give a better
sight, so CC’ing.
Regards
Anatol
From: nicolas.grekas@gmail.com [mailto:nicolas.grekas@gmail.com] On Behalf Of Nicolas Grekas
Sent: Friday, July 31, 2015 4:53 PM
To: Julien Pauli <jpauli@php.net>
Cc: PHP Internals <internals@lists.php.net>
Subject: Re: [PHP-DEV] Exposing object handles to userland
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