Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87579 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44942 invoked from network); 3 Aug 2015 14:39:19 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2015 14:39:19 -0000 Authentication-Results: pb1.pair.com smtp.mail=anatol.php@belski.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=anatol.php@belski.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain belski.net from 85.214.73.107 cause and error) X-PHP-List-Original-Sender: anatol.php@belski.net X-Host-Fingerprint: 85.214.73.107 klapt.com Received: from [85.214.73.107] ([85.214.73.107:40916] helo=h1123647.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 63/00-44469-11D7FB55 for ; Mon, 03 Aug 2015 10:39:14 -0400 Received: by h1123647.serverkompetenz.net (Postfix, from userid 1006) id C890823D6003; Mon, 3 Aug 2015 16:39:06 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on h1123647.serverkompetenz.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.5 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED autolearn=unavailable version=3.3.2 Received: from w530phpdev (pD9FE8E91.dip0.t-ipconnect.de [217.254.142.145]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by h1123647.serverkompetenz.net (Postfix) with ESMTPSA id 88B9E23D6003; Mon, 3 Aug 2015 16:39:01 +0200 (CEST) To: "'Nicolas Grekas'" , "'Rowan Collins'" Cc: References: <024101d0cbaa$f864aa50$e92dfef0$@belski.net> <55BDBE25.5050104@gmail.com> <55BE5B89.5080103@gmail.com> <4557ED13-5446-45F1-8E04-A01F8A066600@gmail.com> In-Reply-To: Date: Mon, 3 Aug 2015 16:38:59 +0200 Message-ID: <04cc01d0cdfa$24490e30$6cdb2a90$@belski.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQEZxEz2AZ24oXNpNMxONv1anupciAKrx7AyAi9zLxwCa9DPhwIfRl9pAjUtux0AZeGwBgJOG7UjARs9F90Bh7u/cADkj8uTntmfRXA= Content-Language: en-us Subject: RE: [PHP-DEV] Exposing object handles to userland From: anatol.php@belski.net ("Anatol Belski") Hi Nicolas, > -----Original Message----- > From: nicolas.grekas@gmail.com [mailto:nicolas.grekas@gmail.com] On = Behalf > Of Nicolas Grekas > Sent: Monday, August 3, 2015 1:29 PM > To: Rowan Collins > Cc: internals@lists.php.net > Subject: Re: [PHP-DEV] Exposing object handles to userland >=20 > > >- 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. > > >=20 > That's not a strong feature, but still, it makes the tool a little bit = more > comfortable to use. >=20 > 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. >=20 > For VarDumper, I don't need spl_objet_id(). As we spotted, the code is = already > able to get the number it needs. >=20 > Having spl_object_id() is still a feature that is not exposed to = userland, but that is > useful as I tried to demonstrate. I'd be on the side of creating new function, too, if it's really needed. = And not touching the old one. As mentinod before, maybe some other = useful cases could be addressed like immutable strings. But with the object id - still, how are the issues mentioned going to be = handled? - handle gets reused within the same script, even in same request. = There's no way to realize an object was garbage collected and completely = another one has the same id. - what is done in the case the internal implementation was changed, = it'll be probably hard to emulate but some apps will already depend on = it. Maybe just incrementing a static variable were simple enough :) But IMHO = these points need to be addressed prior the implementation. Maybe it's = even not reliable enough to rely on the internal implementation. Regards Anatol