Re: New function: spl_object_id() or spl_object_handle()

From: Date: Sat, 29 Nov 2014 18:22:16 +0000
Subject: Re: New function: spl_object_id() or spl_object_handle()
References: 1 2 3 4  Groups: php.internals 
Request: Send a blank email to internals+get-79312@lists.php.net to get a copy of this message
On 28 November 2014 at 21:06, Patrick Schaaf <php@bof.de> wrote: > > I really don't get it. What are you trying to do there that you cannot do > with storing the object (reference) itself? I probably provided a poor explanation. All this was meant as a convenience method for quick debugging. I just needed to quickly check if multiple object references which occur at different points of code execution, actually point to the same object. The question was: was this object reinitialized somewhere in between. Consider this execution flow: |Black Magic| ---> |Code of interest #1| ---> |Black Magi|c ---> |Code of interest #2| ---> ... "Black magic" represents larger chunks of OO code that is not really one's concern at the moment. The quickest way to verify if object refs at all "Code of interest" points (#1, #2, #3... #n) include the same object is to dump the object IDs somewhere (file for example) and visually inspect them. I am not saying it can not be done otherwise (storing objects in some registry, etc), but I am talking about quick and convenient way of doing it. b.

« previous php.internals (#79312) next »