Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92224 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 8472 invoked from network); 12 Apr 2016 13:15:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Apr 2016 13:15:09 -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.22 as permitted sender) X-PHP-List-Original-Sender: cmbecker69@gmx.de X-Host-Fingerprint: 212.227.17.22 mout.gmx.net Received: from [212.227.17.22] ([212.227.17.22:58016] helo=mout.gmx.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 90/0C-28094-CD4FC075 for ; Tue, 12 Apr 2016 09:15:09 -0400 Received: from [192.168.2.102] ([84.187.18.28]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0Lmvlg-1bQ7Fd1L9Y-00h37y; Tue, 12 Apr 2016 15:15:05 +0200 To: Marco Pivetta , PHP Internals List References: Message-ID: <570CF4E4.6070800@gmx.de> Date: Tue, 12 Apr 2016 15:15:16 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:KmzZZGKcJRuZlR41KFyM8hjH1ZeZYC7jGSoMQMQl50A72RUjJQY Rp5ELh1HaLAkSD/6aIY6X2wlVjqVuCeBGul/cpHdAHcjzTMm4YYzqw2RyJLtztWEz5j9HFm eShgFDV05x7JZYcujbPNLSTujGmK2cD/5hxijYnG6ECNgtPx/cjTIaF8ld5KJA3HAUhloy9 NHqdU2V5A3yZp93cj4TFw== X-UI-Out-Filterresults: notjunk:1;V01:K0:P0Po8Y2MUgE=:oEU80cZXJyYmmqi+5RZmut I9ZdYGkcBGGSIEyCHqCxgaIM66T/XttyIq9hvpk6U22g0sVIV2Gn0hAmuei9EZSJQZ8YxPl2d S8TImhN/sR3x4MmMyISvDrHjq4sw5u7Onae2G4RMVOhmydwUvb+6zp2Qa4jTFabYvMVTqDS4k GWoEASvgsfPaWLLPmSqEQ8gTvlMS+uZlZOVj6Ffxn49bE9ji8pLsgXwSTRGPVOoXxdjY7CfET 602eO9vdPLpbXqTehNAXc8ieWkSNSz019XUZB8gwIEGSNuUvFo10hj6XzjxXN7sEvmQTyXZiM 2GdX8xUnkBdpNKlCVvrG/x37s5KOcwPNhdUpbK8zSZ/keCvE3rjh9pl8JCc9/3A95QSrnvjSB JKGUtsK2ggrispgSvjh6NN5OOiB8Zd+6MgGOjfm9kIRBv9ijhhu9IABN9Qh4wnHL08l7mkww0 EY5ESGhW2UpHztGzBXN0aj0PJLCb5qjVsIYoJUNCmJXCuqcaOUdkpidqEthyXISm6uaO87F81 WVWXe7DLxYPLnTP/npMgVJQzCsESNFtBdbaHQKx+6AunjxWf4MNxx/NGKaU3XOkp0U7SltDKr QE04OwUlt3eyf/Znuv4wvL/rCPdpRLKnxJu2xr2b9bnsQhL0xFZ7nxnlrU2OS6vKNWI9b/hK8 h32H/PYEGTHUjrgUkuh16wQZb4gOZl9sIv4UlyUgKcp11MmcKhJiECiffe8jjtTaehG91cjIB amAmsDoSdUU2eYbuFR23FBTI4h7Vi1iM1pSHe5uwX8mZ+CCma4zZgH8FjBjodSkc3Yd7Q5HIV LD74m+x Subject: Re: Array key access on non-array values - to be made illegal? From: cmbecker69@gmx.de (Christoph Becker) On 12.04.2016 at 14:59, Marco Pivetta wrote: > I just stumbled upon behavior that seems to "fail silently" regardless of > its very questionable validity: > > > $a = 1; > > var_dump($a[123]); // NULL, no notice > > https://3v4l.org/b3rDr > > Are there specific reasons why no notice is thrown? Is it by design? If so, > does anyone remember why? > > I haven't checked if this affects other types too. I know that an > assignment to an array key of a non-array would cause a cast of the value > to `array`, but a mere read operation should surely cause a notice to be > raised in the above scenario. For the record: there are several bug reports/feature requests regarding this issue, e.g. . -- Christoph M. Becker