Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87440 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 63388 invoked from network); 31 Jul 2015 14:44:21 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jul 2015 14:44:21 -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:40520] helo=h1123647.serverkompetenz.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C9/23-47755-0C98BB55 for ; Fri, 31 Jul 2015 10:44:17 -0400 Received: by h1123647.serverkompetenz.net (Postfix, from userid 1006) id D92AB23D615C; Fri, 31 Jul 2015 16:44:13 +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=ham version=3.3.2 Received: from w530phpdev (pD9FE8EAF.dip0.t-ipconnect.de [217.254.142.175]) (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 8221B23D6003; Fri, 31 Jul 2015 16:44:12 +0200 (CEST) To: "'Julien Pauli'" , "'PHP Internals'" References: In-Reply-To: Date: Fri, 31 Jul 2015 16:44:11 +0200 Message-ID: <01ca01d0cb9f$5fbbb4c0$1f331e40$@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: AQEZxEz2AZ24oXNpNMxONv1anupciJ9js3yg Content-Language: en-us Subject: RE: [PHP-DEV] Exposing object handles to userland From: anatol.php@belski.net ("Anatol Belski") Hi, > -----Original Message----- > From: julienpauli@gmail.com [mailto:julienpauli@gmail.com] On Behalf = Of > Julien Pauli > Sent: Friday, July 31, 2015 4:24 PM > To: PHP Internals > Subject: [PHP-DEV] Exposing object handles to userland >=20 > Hi people. >=20 > I've been pinged many times to add a new spl_object_id() function to = PHP, that > would return the internal object handle of an object. >=20 > Today, spl_object_hash() partially allows that, but adds many = randomness to the > result, which is not very cool to use later (why does it even add = randomness ?). >=20 > There has been topics about this subject. > For example, at = http://marc.info/?l=3Dphp-internals&m=3D141814350920452&w=3D2 >=20 >=20 > Beeing able to get the object handle back in PHP userland would ease = many > tools, mainly debug-oriented tools. > I know PHPUnit, Symfony and many big projects today make use of > spl_object_hash() to identify objects. >=20 > I also know people that print_r($an_object) and parse the output just = to extract > the object handle from there... Crazy isn't it ? > Why couldn't we help those people by simply adding a new function that = does > the job ? >=20 Regarding the ID keywords, that reminds on = https://docs.python.org/2/library/functions.html#id . While not = everything is object in PHP, fe it could be interesting at least for the = strings since we have interned strings. Maybe there were some wider = range of useful information to provide in user land, not only related to = objects. Regards Anatol