Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86532 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 28233 invoked from network); 9 Jun 2015 20:16:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jun 2015 20:16:56 -0000 Authentication-Results: pb1.pair.com smtp.mail=cmbecker69@gmx.de; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=cmbecker69@gmx.de; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmx.de designates 212.227.17.21 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.21 mout.gmx.net Received: from [212.227.17.21] ([212.227.17.21:49806] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EA/1A-00828-6B947755 for ; Tue, 09 Jun 2015 16:16:55 -0400 Received: from [192.168.0.100] ([95.89.139.132]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Lfolq-1ZQFR339B4-00pMSq; Tue, 09 Jun 2015 22:16:51 +0200 Message-ID: <557749B6.8060301@gmx.de> Date: Tue, 09 Jun 2015 22:16:54 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Rowan Collins , internals@lists.php.net References: <5576051A.3040800@gmx.de> <55760771.6020802@gmail.com> <778F345F9918474AB8CAAB03082ECBF7@pc1> <5576DC09.8050705@gmail.com> <5576E58B.2000404@gmx.de> <5576F20D.7040304@gmail.com> In-Reply-To: <5576F20D.7040304@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:6pO4yRtHQnKY5AoGuQxSEnrpINfY4oxG9hECNZzf7eKbzIMH1h1 8EF75vGju1m3/BcldywqlJpTwwjR0TaeBpV7sU7LsyaTovRVmIhlzrHNEI6xU43eEUdnfky N3SPqkS/gqmfKCfDHyUXO7GsdYqj49rqzam1EOVT6wgN3HVEVGCogaAnHHycqKXRTcnlW51 n5LWZTigCz5wCUV2il3bw== X-UI-Out-Filterresults: notjunk:1;V01:K0:gKPsBEPqCPQ=:BFoph7gecKZpoBkcabFfRG GxTTLhhB4excaU3YCeCn7c5K5SZSH8WuldWnlNh3AHsb3aCQ3kQEsytH+20FVZ/6/tZnXuXsq pQx5fsm0wRicOI75jbGYWea7UaJeCczCe04YBjaILVgHnS4xOKn9hZBhNMbuHt78Ys6iXUYeH p4uGyjsos0QCj8e8waqgqRnCfYSRuoLF3ossjjYxVqcz9+tg7BE3o7lJervsEgRDMhWtYCc7O HcX/+asGYrKrSb+wt+SHbKQZ6a+HybxeA5HI4Tc5S7QvNyFMFmMjVyqGQWh7poS/X8TUt0zos vLmk8psDwscWUQueS03CnMrtm7vFUL1Vl8SWz5JGk9yy2obisVPoGLtHUveqcki4dNrxxhpN/ of7Zy5HXEGMRAAOCKVYAegborAP6pTYXlnG5ITx87+n7jaW62QrF1f7ZFT6MlkgEWnsxoQSeo OHX3hX1uau1oNMyxmeS2+CAOF+lzUprpauyaJweXOeG+zpbmFVVK0SFL35JD+Kb4zIRmB9/gK UUqlyXr0Y7KNsgJpaI7vRszoLWhsZTcBDT73w8YCpz01PdrBJsL91tf/baoCp0ONo9eDsaDLN T0abk7ukpmx5HQzVLNbl9Qkzrg7dKRtcvOUZRiFLbj/FD39+hJ91Jb1IJXxF0138WJFcypBjg 4Q6U0Des+747YXcm1rX5PbY8yiC2f9QKMsHGdcy7b1XeceYCWxy5HZXvYUTBMjwDmD84= Subject: Re: [PHP-DEV] Array dereferencing of scalars From: cmbecker69@gmx.de (Christoph Becker) Rowan Collins wrote: > Christoph Becker wrote on 09/06/2015 14:09: >> I wonder where these coercion rules are described. The manual has a >> section about "Converting to array"[1] which actually describes casting, >> and is obviously not what is happening when the subscript operator (as >> the langspec calls it[2]) is applied to non-null scalars. > > There's a manual page on "Type Juggling" which is probably more > relevant: http://php.net/manual/en/language.types.type-juggling.php > > Interestingly, it notes that: > >> The behaviour of an automatic conversion to array is currently undefined. Thanks. I've missed that. It explains the current behavior. > So, at least as far as that reference point is concerned, any change in > behaviour could be justified (if agreed by RFC) as defining what was > previously undefined. I would welcome that. In my opinion, undefined behavior is better avoided in a language specification. -- Christoph M. Becker