Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:79287 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75745 invoked from network); 28 Nov 2014 19:22:59 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 28 Nov 2014 19:22:59 -0000 Authentication-Results: pb1.pair.com smtp.mail=bostjan@a2o.si; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=bostjan@a2o.si; 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:37132] helo=portkey.s.itsis.si) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 14/D1-59154-19BC8745 for ; Fri, 28 Nov 2014 14:22:57 -0500 Received: from undisclosed (undisclosed [127.0.0.254]) (Authenticated sender: undisclosed) by portkey.s.itsis.si (Postfix) with ESMTPSA id B47688006B for ; Fri, 28 Nov 2014 19:22:53 +0000 (UTC) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.98.4 at portkey Received: by mail-ig0-f180.google.com with SMTP id h15so6097036igd.13 for ; Fri, 28 Nov 2014 11:22:51 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.107.14.208 with SMTP id 199mr27513115ioo.28.1417202571910; Fri, 28 Nov 2014 11:22:51 -0800 (PST) Received: by 10.50.35.1 with HTTP; Fri, 28 Nov 2014 11:22:51 -0800 (PST) In-Reply-To: References: Date: Fri, 28 Nov 2014 20:22:51 +0100 Message-ID: To: reeze Cc: PHP Internals List Content-Type: multipart/alternative; boundary=001a113face2dfa6b10508f02f05 Subject: Re: [PHP-DEV] New function: spl_object_id() or spl_object_handle() From: bostjan@a2o.si (Bostjan Skufca) --001a113face2dfa6b10508f02f05 Content-Type: text/plain; charset=UTF-8 On 28 November 2014 at 04:10, reeze wrote: > Won't `$obj1 === $obj2` work for you ? > This works if you have two objects which are easily accessible in the same scope. Not that it can not be done this way, but it may require jumping through hoops to get two object references into the common scope where you can compare them. By having a method to retrieve and display object id/handle, one can easily compare identity of objects in various scopes, and/or at various execution times/points. Think of it like this: - in file bootstrap.php I see this object initialized and passed somewhere - in file view.phtml I receive the object of the same type, but how can I be sure that this object was not re-initialized somewhere in between? b. --001a113face2dfa6b10508f02f05--