Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54058 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 49158 invoked from network); 18 Jul 2011 21:00:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2011 21:00:27 -0000 Authentication-Results: pb1.pair.com header.from=ekneuss@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ekneuss@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.46 as permitted sender) X-PHP-List-Original-Sender: ekneuss@gmail.com X-Host-Fingerprint: 209.85.161.46 mail-fx0-f46.google.com Received: from [209.85.161.46] ([209.85.161.46:33230] helo=mail-fx0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 99/D0-38309-1DE942E4 for ; Mon, 18 Jul 2011 17:00:24 -0400 Received: by fxh19 with SMTP id 19so6908304fxh.19 for ; Mon, 18 Jul 2011 13:59:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=Qd0uOZRLHiMGnUtQzNAGXrpSjwfqjFjRAWaxNwVpWdQ=; b=F5ETgmNoAVvUWyEovAMekruZ8pE23/N8YLVi6CixVhSnZgrWb83kEuKGX0YNZiJ9Cv RnyMhLkCf/YsgQJTJ4/396up9C0ipFycqrR3z+rTOy6dsmowB+l3b2vuRlZPk4VRPX+J zcjJZzehHPB+NeXHPCPYdvje8pof0SQ+efsuo= MIME-Version: 1.0 Received: by 10.204.174.65 with SMTP id s1mr1903313bkz.375.1311022795095; Mon, 18 Jul 2011 13:59:55 -0700 (PDT) Sender: ekneuss@gmail.com Received: by 10.204.122.80 with HTTP; Mon, 18 Jul 2011 13:59:55 -0700 (PDT) In-Reply-To: References: Date: Mon, 18 Jul 2011 22:59:55 +0200 X-Google-Sender-Auth: 2QDpQxjKIUHdDIRsIK1WBy9kiYs Message-ID: To: Adam Harvey Cc: Hannes Landeholm , internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Weak References From: colder@php.net (Etienne Kneuss) Hi, On Mon, Jul 18, 2011 at 20:12, Adam Harvey wrote: > On Jul 18, 2011 9:20 AM, "Hannes Landeholm" wrote: >> In a nutshell: The RFC proposes adding a single class called "SplWeakRef" >> which provides the "Weak Reference" feature. This is the only change. > > This may just be Monday morning fuzziness, or I've just missed something in > the RFC, but is there a reason weak references would be limited solely to > objects, rather than any variable that can be dealt with by-reference? Other kinds of variables does not allow us to define specific hooks like for objects. Implementing weak references (note that in this context reference != php reference, but object reference) for other types would require considerable changes to the engine, which we are trying to avoid here. In this case, for objects, the implementation remains quite simple, because objects allow such introspection already. Last but not least, it also makes little sense to do so from a design perspective, as other types do not provide the handle indirection that objects do. > > Thanks, > > Adam -- Etienne Kneuss http://www.colder.ch