Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:86526 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2809 invoked from network); 9 Jun 2015 14:04:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jun 2015 14:04:39 -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.50 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 74.125.82.50 mail-wg0-f50.google.com Received: from [74.125.82.50] ([74.125.82.50:33407] helo=mail-wg0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id E2/46-00828-572F6755 for ; Tue, 09 Jun 2015 10:04:37 -0400 Received: by wgez8 with SMTP id z8so14406834wge.0 for ; Tue, 09 Jun 2015 07:04:34 -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:content-transfer-encoding; bh=fhhJ1RaAb5Upwqsi9yQX+yiwg4Zekg9J9IKBd+QyXDk=; b=N1Zj23Jh9R9dmB+phiJmNX6HLfNQ/Tu7sKSaTaU73lIe0HmSBfkGhJRiD1npX51CIu L2SLLoIKMJOR6e8Qa+/E5rMTXsKvCCR2E9/l2BSphdkNQeU1iRg3BcwnSq29vS2zjWiO TU5G8VpRpo4zA6Wd8UcyeVNJQQhYBWDBcJIeKg6MtJYndkc/yZO/BtJko+zeyp2YesHM Q+zXF7N49+SUzGHoCK0aWBNkyrRwYrqDTyOxqqIhA+CukhfocXNU+WdOoRyTc3Mzhdpy QQUYndyvreygNJwucj6bX0lHEDLpyxgtwqZHgq0vkZdXSwBMZEzMfhDXDdj8eJ43ooK/ NaFw== X-Received: by 10.181.11.229 with SMTP id el5mr33025466wid.40.1433858674446; Tue, 09 Jun 2015 07:04:34 -0700 (PDT) Received: from [192.168.0.159] ([62.189.198.114]) by mx.google.com with ESMTPSA id ef10sm9618020wjd.49.2015.06.09.07.04.32 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jun 2015 07:04:33 -0700 (PDT) Message-ID: <5576F20D.7040304@gmail.com> Date: Tue, 09 Jun 2015 15:02:53 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: internals@lists.php.net References: <5576051A.3040800@gmx.de> <55760771.6020802@gmail.com> <778F345F9918474AB8CAAB03082ECBF7@pc1> <5576DC09.8050705@gmail.com> <5576E58B.2000404@gmx.de> In-Reply-To: <5576E58B.2000404@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [PHP-DEV] Array dereferencing of scalars From: rowan.collins@gmail.com (Rowan Collins) 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. 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. Regards, -- Rowan Collins [IMSoP]