Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79312 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 66718 invoked from network); 29 Nov 2014 18:22:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 29 Nov 2014 18:22:21 -0000 Authentication-Results: pb1.pair.com header.from=bostjan@a2o.si; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=bostjan@a2o.si; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain a2o.si designates 78.47.12.76 as permitted sender) X-PHP-List-Original-Sender: bostjan@a2o.si X-Host-Fingerprint: 78.47.12.76 portkey.s.itsis.si Received: from [78.47.12.76] ([78.47.12.76:57008] helo=portkey.s.itsis.si) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 0B/B0-62697-DDE0A745 for ; Sat, 29 Nov 2014 13:22:21 -0500 Received: from undisclosed (undisclosed [127.0.0.254]) (Authenticated sender: undisclosed) by portkey.s.itsis.si (Postfix) with ESMTPSA id 4ED548006E for ; Sat, 29 Nov 2014 18:22:18 +0000 (UTC) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.98.4 at portkey Received: by mail-ie0-f170.google.com with SMTP id rd18so7489958iec.15 for ; Sat, 29 Nov 2014 10:22:16 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.107.14.208 with SMTP id 199mr31473869ioo.28.1417285336708; Sat, 29 Nov 2014 10:22:16 -0800 (PST) Received: by 10.50.35.1 with HTTP; Sat, 29 Nov 2014 10:22:16 -0800 (PST) In-Reply-To: References: Date: Sat, 29 Nov 2014 19:22:16 +0100 Message-ID: To: Patrick Schaaf Cc: internals , reeze Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle() From: bostjan@a2o.si (Bostjan Skufca) On 28 November 2014 at 21:06, Patrick Schaaf 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.