Re: Exposing object handles to userland
| From: | Nicolas Grekas | Date: | Mon, 03 Aug 2015 11:28:48 +0000 |
| Subject: | Re: Exposing object handles to userland | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-87571@lists.php.net to get a copy of this message | ||
> >- more importantly for users, these ids couldn't be compared to
> >var_dumps'.
>
> Why do you need to compare the output of two dump functions? Just add a
> note to the documentation that these are not the same IDs.
>
That's not a strong feature, but still, it makes the tool a little bit more
comfortable to use.
Oh, and an other benefit of the handle is that it gives a rough estimation
of the number of objects created and their instantiation order. When
debugging, any hints count.
For VarDumper, I don't need spl_objet_id(). As we spotted, the code is
already able to get the number it needs.
Having spl_object_id() is still a feature that is not exposed to userland,
but that is useful as I tried to demonstrate.