Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:54055 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 33541 invoked from network); 18 Jul 2011 18:50:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Jul 2011 18:50:57 -0000 Authentication-Results: pb1.pair.com smtp.mail=landeholm@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=landeholm@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.170 as permitted sender) X-PHP-List-Original-Sender: landeholm@gmail.com X-Host-Fingerprint: 209.85.214.170 mail-iw0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:36063] helo=mail-iw0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 23/12-08769-090842E4 for ; Mon, 18 Jul 2011 14:50:57 -0400 Received: by iwn36 with SMTP id 36so3608409iwn.29 for ; Mon, 18 Jul 2011 11:50:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=24g5dKbvDaVHTrQM9YgQHBQY8VXvAuTS50lajtsQ2k0=; b=VvE0IVpHhwLK2pXY9bZNMeHUcGB+XtWVoEkE1E/RQc4mLkt48qY1hXNDPx79kY9BFK Y2sHMnknB8bK07CW/0MCLcUkVfQ9BQA/IhyHyB0UAA66qcTjdFBJ4Catv8mfOMotLgD9 X69/iVCc8gpp2QDL5xdx9SRhuVfpzSk1EZyg0= MIME-Version: 1.0 Received: by 10.231.48.143 with SMTP id r15mr6089509ibf.47.1311015054340; Mon, 18 Jul 2011 11:50:54 -0700 (PDT) Received: by 10.231.37.11 with HTTP; Mon, 18 Jul 2011 11:50:54 -0700 (PDT) In-Reply-To: References: Date: Mon, 18 Jul 2011 20:50:54 +0200 Message-ID: To: Adam Harvey , internals@lists.php.net Content-Type: multipart/alternative; boundary=0015176f07509bf24104a85c7a4b Subject: Re: [PHP-DEV] [RFC] Weak References From: landeholm@gmail.com (Hannes Landeholm) --0015176f07509bf24104a85c7a4b Content-Type: text/plain; charset=ISO-8859-1 Weak references is an OOP concept. Scalar data types and arrays are not OOP-related so I don't think that would make sense. Variable references is not the same as object references. A variable reference is simply a variable that is connected with another variable (if you set one it will change the other). If two variables have the same object reference they are not connected, if you set one variable the other is still set to the initial object reference. Also, arays and strings have special memory handling - they use lazy copying so it's opaque if two equal arrays/strings refer to the same region of memory. It's unclear what construction/destruction even mean in that sense. An array might actually have been "constructed" by the compiler. A reference to an object instance is a "pointer" but a reference to a variable is not. http://us.php.net/manual/en/language.references.arent.php I hope that illustrates the difference. Do you have any special use case in mind? ~Hannes On 18 July 2011 20:12, Adam Harvey wrote: > > 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? > > Thanks, > > Adam > --0015176f07509bf24104a85c7a4b--