Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87456 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 98235 invoked from network); 31 Jul 2015 20:09:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jul 2015 20:09:02 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.182 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.212.182 mail-wi0-f182.google.com Received: from [209.85.212.182] ([209.85.212.182:32771] helo=mail-wi0-f182.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id DA/B1-24609-BD5DBB55 for ; Fri, 31 Jul 2015 16:08:59 -0400 Received: by wicmv11 with SMTP id mv11so70346249wic.0 for ; Fri, 31 Jul 2015 13:08:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=bRaIPEnQ6cUhgIX5ymf2m10muuq12EHQaaGzaBJ8itI=; b=jxLvf/fvQXoCJG806goOm2u1dbX70m62WTDsvaraRlU6xhGlvZXAjwedsSbP1YiNaR MA51QXXNZtnFPPRwRTqcHSrVAuIUFUdzrbQ9RIGEXkPKPHXPin1WOKjcNbWuJjp26DoP z/crTVNiyxT2UROTor6GomJzykfRb65+iKjeKUBgMUHUU3Td6O0G0GFBa0UdWGSLWshb MHahRSPX3H/d/BOCTkdmhEV8hW/et2VrvTnCEC5FcBA5wEsRm4w7gyGMBKq3FqOWJ3X5 km4giZxq0gDahFPeZhwwXBpcTdiJ5TQksXQearWMeRm1ZFuaoglLxynHai0UehtJlGZJ UNiA== MIME-Version: 1.0 X-Received: by 10.180.188.137 with SMTP id ga9mr10222590wic.11.1438373336815; Fri, 31 Jul 2015 13:08:56 -0700 (PDT) Received: by 10.27.3.85 with HTTP; Fri, 31 Jul 2015 13:08:56 -0700 (PDT) In-Reply-To: References: Date: Fri, 31 Jul 2015 22:08:56 +0200 Message-ID: To: Nicolas Grekas Cc: Julien Pauli , PHP Internals Content-Type: multipart/alternative; boundary=001a11c38758cb9eb0051c3163a7 Subject: Re: [PHP-DEV] Exposing object handles to userland From: nikita.ppv@gmail.com (Nikita Popov) --001a11c38758cb9eb0051c3163a7 Content-Type: text/plain; charset=UTF-8 On Fri, Jul 31, 2015 at 4:53 PM, Nicolas Grekas < nicolas.grekas+php@gmail.com> wrote: > > 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 ? >> > > I plead guilty for doing this, but php let me no better choice for now ;) > > The attached patch removes the XOR hashing for the object handle (it's > useless, the "secret" is trivially guessed after parsing the output of > var_dump). > > It would be awesome if this patch could be applied for php 7.0! > > Cheers, > Nicolas > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php I'd prefer to add a separate function spl_object_id, which directly returns the handle. This should supersede spl_object_hash in the long run. spl_object_hash does a bunch of pointless things that serve no purpose other than making the function slower and making the result more bulky. Nikita --001a11c38758cb9eb0051c3163a7--