Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:74814 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64358 invoked from network); 10 Jun 2014 11:38:28 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 10 Jun 2014 11:38:28 -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 74.125.82.174 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.174 mail-we0-f174.google.com Received: from [74.125.82.174] ([74.125.82.174:64943] helo=mail-we0-f174.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 32/63-42235-13EE6935 for ; Tue, 10 Jun 2014 07:38:27 -0400 Received: by mail-we0-f174.google.com with SMTP id k48so7401603wev.33 for ; Tue, 10 Jun 2014 04:38:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type; bh=/2AfN5izQ5rFeUnU5uwWd7FoPw0fKQck0CHH5ldxamw=; b=xp7rdWPhPZzq4R2rSwf1ViEJ91ZDOUuX0/NaDd4SUkyO/CneUlnYXUPfVXUv8C6Hoz m2WDV6y3rquHI1I/hOc2EvWheAFebZ8NT7wSFJhRSxb1LADSziZ2YSQzZQV2t9Ti+yQS 06QElVl2w8/FGCSbcqT4xvPW332I+2/QGgOuVX6rwYL57vmrIZcUlQ4g9u9xmpvDryL8 kp3i3WbQRURbvnqNc/yS/q08OL8UOe0TOBUzmHkQeW+mhw3q0x/QPg+j0US7bNgHD58Z jEh0vU03gEzJB/klQwa/4i12u/cPNgkJ0jvdRNXQge/6CVVnpJ3hacjOFHoL1mCyvIHz RDww== X-Received: by 10.194.110.71 with SMTP id hy7mr40748901wjb.23.1402400302490; Tue, 10 Jun 2014 04:38:22 -0700 (PDT) Received: from [192.168.0.139] ([62.189.198.114]) by mx.google.com with ESMTPSA id y10sm20296153wix.24.2014.06.10.04.38.21 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 04:38:21 -0700 (PDT) Message-ID: <5396EE23.7040909@gmail.com> Date: Tue, 10 Jun 2014 12:38:11 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: internals@lists.php.net References: <5395CC8D.5060702@anderiasch.de> <5395DB90.40307@gmail.com> In-Reply-To: <5395DB90.40307@gmail.com> Content-Type: multipart/alternative; boundary="------------020202030403080900060407" Subject: Re: [PHP-DEV] [RFC] [PHP 6] Uniform Variable Syntax From: rowan.collins@gmail.com (Rowan Collins) --------------020202030403080900060407 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Rowan Collins wrote (on 09/06/2014): > The advantage of the proposed behaviour is that it can be easily > explained to *new* users of the language, as it's internally > consistent, which appears not to be true of the old - an example in > the RFC being |Foo::$bar[1][2][3] vs ||Foo::$bar[1][2][3]()| A simpler example of the current logic's inconsistencies: $foo = 'foo'; $bar->$foo = array(); $bar->$foo[0] = 42; // $bar now has an array on ->foo, and an integer on ->f http://3v4l.org/pImS3 Not only does this not feel consistent in itself, it's different if you do the same thing with an object: $foo = 'foo'; $bar->$foo = new stdClass; $bar->$foo->x = 42; // $bar now has a single property ->foo, which is an object with property ->x http://3v4l.org/DUaJj Other than "it's always worked this way", I can't think of a good justification for this difference. -- Rowan Collins [IMSoP] --------------020202030403080900060407--