Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87525 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 97566 invoked from network); 2 Aug 2015 18:04:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Aug 2015 18:04:01 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.212.169 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.212.169 mail-wi0-f169.google.com Received: from [209.85.212.169] ([209.85.212.169:33869] helo=mail-wi0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 61/D5-55344-E8B5EB55 for ; Sun, 02 Aug 2015 14:03:59 -0400 Received: by wibud3 with SMTP id ud3so110487118wib.1 for ; Sun, 02 Aug 2015 11:03:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=l7lTSiAb0MlcqDyrxn0UpXmf+ZT69nSNgPDygOQq9+I=; b=NOcyMzz27ZQhLmTHBxZ2ipABNll21I7RiY9lkCkEiN6GFG+EwjPnAF6IHM+zNzLQBu DfoF3vARdEZ++z9iJEIKvmP6pgEz39tEGtV7/bMgY9GG8kW4P8TlT7njqcKf+0oELGhr wjS9MsEQRxb3GN0zUXXj4g5zEE4PoGMq48HmUP6wvyAYY1e2XbC8PAtZJcJzZpSGBFAj 8QvFpFoXO1R6ZYijdTZ4bO1k+T0qJc+8xrj6U1s4o5GdkSIK5jWnNGn6qvabu39U24dJ 7ozflANI+HU5MXbIFKBTLPPdReCTr5WkJtXBisJf6rMKK2/zLhcvmX9nH2Lor337wDHN y+HQ== X-Received: by 10.180.97.129 with SMTP id ea1mr27467519wib.24.1438538635572; Sun, 02 Aug 2015 11:03:55 -0700 (PDT) Received: from [192.168.0.5] (cpc68956-brig15-2-0-cust215.3-3.cable.virginm.net. [82.6.24.216]) by smtp.googlemail.com with ESMTPSA id uo6sm18653459wjc.1.2015.08.02.11.03.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 11:03:55 -0700 (PDT) To: internals@lists.php.net References: <024101d0cbaa$f864aa50$e92dfef0$@belski.net> <55BDBE25.5050104@gmail.com> Message-ID: <55BE5B89.5080103@gmail.com> Date: Sun, 2 Aug 2015 19:03:53 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Exposing object handles to userland From: rowan.collins@gmail.com (Rowan Collins) On 02/08/2015 18:41, Bob Weinand wrote: >> Some suspicious use of spl_object_hash() out there... >> > >>> >>https://github.com/symfony/symfony/blob/master/src/Symfony/Component/VarDumper/Cloner/VarCloner.php >> > >> >Not sure what this one does... but calculations with spl_object_hash() >> >look very suspicious. > Actually, it's doing the right thing… calculating the value the object id is xor'ed with (as we know that consecutively defined objects have consecutive ids). > It's relying on the implementation of spl_object_hash() and will even continue to work when we remove that part of randomness as that value it's xor'ed with is then nothing else than 0. The right thing for what purpose? Why does it need that ID, rather than the value that spl_object_hash() gave in the first place? Just to be prettier to the user? Regards, -- Rowan Collins [IMSoP]