Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87492 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74451 invoked from network); 2 Aug 2015 07:07:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Aug 2015 07:07:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=smalyshev@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=smalyshev@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.49 as permitted sender) X-PHP-List-Original-Sender: smalyshev@gmail.com X-Host-Fingerprint: 209.85.220.49 mail-pa0-f49.google.com Received: from [209.85.220.49] ([209.85.220.49:33050] helo=mail-pa0-f49.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 59/50-05719-0A1CDB55 for ; Sun, 02 Aug 2015 03:07:12 -0400 Received: by padck2 with SMTP id ck2so66157913pad.0 for ; Sun, 02 Aug 2015 00:07:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=glUlKjnAqpbQv8MSWdPo3yWlwLiBq6YpCdPyfk1UBRo=; b=XCOBLJBO9pA1mj7yVeDaf+jzdlhVYZQdS5eMtkud5+KfVzWzr7ywIi0tRiGcg+aPwT y1DvogaWB5na4pm8+gvpuRqO2AMBT0SEWDSGjN4HW9RVhseBCJeWszc9AkFQK5TxNvdx 8TMUIOZ4kyQujSBiZuLSC+Ya+oYw9AMRQxXotK0erzqbn8lT4hgA4GIwzKwqE+3c/TBW HGVutbyMXI7RRta+YSVZFdaIZV3tPSzR1eN6jFg9rSm1JlcyM6PBKf732MGc5m8GF4My RIPyaImil4/jBEsKSG5JT/qEvNXTQOMbXaWlo2fykHZ9rY7IDMGPj9pB0uf1sCUOkYIS akuw== X-Received: by 10.68.250.228 with SMTP id zf4mr12279310pbc.90.1438499229275; Sun, 02 Aug 2015 00:07:09 -0700 (PDT) Received: from Stas-Air.local (108-66-6-48.lightspeed.sntcca.sbcglobal.net. [108.66.6.48]) by smtp.gmail.com with ESMTPSA id nm1sm3921466pbc.16.2015.08.02.00.07.08 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Aug 2015 00:07:08 -0700 (PDT) To: Nikita Popov , Nicolas Grekas References: Cc: Julien Pauli , PHP Internals X-Enigmail-Draft-Status: N1110 Message-ID: <55BDC196.1030306@gmail.com> Date: Sun, 2 Aug 2015 00:07:02 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Exposing object handles to userland From: smalyshev@gmail.com (Stanislav Malyshev) Hi! > 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. Since in PHP 7 there's no longer a possibility of having different object stores, as far as I can see, spl_object_id can identify an object (it wasn't possible before 7). However, committing to having specific object ID (e.g. as integer) as part of public API is pretty big commitment which I personally think creates unnecessary coupling between PHP internals and user code and is a bad design decision which may bite us later. > 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. Before PHP 7, it created proper object identification, as objects could be stored in different stores. As PHP 7 removed that possibility, indeed adding Z_OBJ_HT_P is no longer serving any purpose. Performance though has very little to do with it - it's just two XORs and one printf. -- Stas Malyshev smalyshev@gmail.com