Re: Exposing object handles to userland
| From: | tyson andre | Date: | Thu, 06 Jul 2017 05:23:18 +0000 |
| Subject: | Re: Exposing object handles to userland | ||
| References: | 1 2 3 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-99783@lists.php.net to get a copy of this message | ||
Updated https://github.com/TysonAndre/php-src/pull/1
, which is now much shorter.
In response to Nikita Popov's comments:
> I'm +1 on the addition and would be fine with including it without RFC, if
> there are no objections on internals.
How long should I wait to see if there are objections before creating a pull request?
> > - Can two objects can have the same object id
> > but different object handlers?
> No: In PHP 7 this is not possible, which is also why spl_object_hash() no
> longer includes the handlers.
True. Checking again, the implementation of spl_object_hash
doesn't include the handlers, so I don't need to worry.
> You can drop the masking. It was never effective at what it's supposed to
> do (hide memory addresses), but as this is the object ID only, it is
> completely unnecessary here.
> [...]
> Only in the sense that it could theoretically wrap around to negative
> numbers. Of course those would still serve as IDs just as well.
That makes sense. I'm omitting the XOR
(and returning the unobfuscated object handle/id)
in the proposed change, then.