Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:87570 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 21783 invoked from network); 3 Aug 2015 11:28:07 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Aug 2015 11:28:07 -0000 Authentication-Results: pb1.pair.com smtp.mail=lester@lsces.co.uk; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=lester@lsces.co.uk; sender-id=unknown Received-SPF: error (pb1.pair.com: domain lsces.co.uk from 217.147.176.214 cause and error) X-PHP-List-Original-Sender: lester@lsces.co.uk X-Host-Fingerprint: 217.147.176.214 mail4-2.serversure.net Linux 2.6 Received: from [217.147.176.214] ([217.147.176.214:37683] helo=mail4.serversure.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CB/91-13081-3405FB55 for ; Mon, 03 Aug 2015 07:28:06 -0400 Received: (qmail 7118 invoked by uid 89); 3 Aug 2015 11:28:00 -0000 Received: by simscan 1.3.1 ppid: 7112, pid: 7115, t: 0.0616s scanners: attach: 1.3.1 clamav: 0.96/m:52/d:10677 Received: from unknown (HELO ?10.0.0.8?) (lester@rainbowdigitalmedia.org.uk@81.157.58.188) by mail4.serversure.net with ESMTPA; 3 Aug 2015 11:28:00 -0000 To: internals@lists.php.net References: <55BDC196.1030306@gmail.com> <55BDDD6D.2060802@gmail.com> Message-ID: <55BF5040.60407@lsces.co.uk> Date: Mon, 3 Aug 2015 12:28:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <55BDDD6D.2060802@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Exposing object handles to userland From: lester@lsces.co.uk (Lester Caine) On 02/08/15 10:05, Stanislav Malyshev wrote: >> I'd more than happy to have an spl_object_id() function btw! > I wouldn't be very happy, because it is wrong design to base userland > PHP code on a detail of an implementation of the engine. That's why > there was a hash and not direct ID - so that the code would not depend > on implementation detail and anything that produces different hash for > different objects would work. > The alternative (stuffing the ID into spl_object_hash) is worse however. What is actually trying to be achieved? A set of objects get created to cache material from another source. One needs a way of identifying the set of buckets which are the raw pointers to each object? Once a bucket is populated then it's identity is part of the bucket. Identifying if a record has already been loaded should happen before wasting the time to download it again? Alternatively a duplicate may be required which retains the same identity until one is happy to replace the original or roll back. The 'identity' is something in the bucket not something that any handle can address? It's implementation not a generic function. -- Lester Caine - G8HFL ----------------------------- Contact - http://lsces.co.uk/wiki/?page=contact L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve - http://enquirysolve.com/ Model Engineers Digital Workshop - http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk