Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:94769 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 85575 invoked from network); 31 Jul 2016 20:04:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 31 Jul 2016 20:04:20 -0000 Authentication-Results: pb1.pair.com header.from=me@kelunik.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=me@kelunik.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain kelunik.com from 81.169.146.162 cause and error) X-PHP-List-Original-Sender: me@kelunik.com X-Host-Fingerprint: 81.169.146.162 mo4-p00-ob.smtp.rzone.de Received: from [81.169.146.162] ([81.169.146.162:36806] helo=mo4-p00-ob.smtp.rzone.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 46/C0-13425-1C95E975 for ; Sun, 31 Jul 2016 16:04:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1469995453; l=5864; s=domk; d=kelunik.com; h=Content-Type:Cc:To:Subject:Date:From:References:In-Reply-To: MIME-Version; bh=z2/xi4FE2lGg49yheExxruRnt3xWFXIr6wgctVfmzNc=; b=bNVQAJlIdwKVemX9Od7ZqAQI2T5jeWW1JPJzJY8QDWpiMGznt1xmOUvWFOJXxKs/2vs jOrqvHYTp+8UjJvDiCDCBSYZEubFdygznFHFVxriX+xcHqolqZgtteb5BlKcvMZv2Rwex oblhUWx0WcuuMcwDEnT/7IQ7Toc4sR6xgxI= X-RZG-AUTH: :IWkkfkWkbvHsXQGmRYmUo9mls2vWuiu+7SLGvomb4bl9EfHtO3E6 X-RZG-CLASS-ID: mo00 Received: from mail-wm0-f42.google.com ([74.125.82.42]) by smtp.strato.de (RZmta 38.13 AUTH) with ESMTPSA id w067e5s6VK4CLB8 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp384r1 with 384 ECDH bits, eq. 7680 bits RSA)) (Client did not present a certificate) for ; Sun, 31 Jul 2016 22:04:12 +0200 (CEST) Received: by mail-wm0-f42.google.com with SMTP id q128so346880876wma.1 for ; Sun, 31 Jul 2016 13:04:12 -0700 (PDT) X-Gm-Message-State: AEkoouui2CdT8RB/fOqTve16qduxrLVFLW7me+cxPlDWaubtXF1O9HhVEEvprZ/wYZzVRefzQ1gVz5oeqaH7Uw== X-Received: by 10.194.63.39 with SMTP id d7mr47259702wjs.13.1469995452223; Sun, 31 Jul 2016 13:04:12 -0700 (PDT) MIME-Version: 1.0 Received: by 10.28.27.206 with HTTP; Sun, 31 Jul 2016 13:04:11 -0700 (PDT) In-Reply-To: References: Date: Sun, 31 Jul 2016 22:04:11 +0200 X-Gmail-Original-Message-ID: Message-ID: To: David Walker , Bob Weinand Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7ba97ce0c0c1150538f3fca6 Subject: Re: [PHP-DEV] [RFC] E_NOTICE for invalid array container From: me@kelunik.com (Niklas Keller) --047d7ba97ce0c0c1150538f3fca6 Content-Type: text/plain; charset=UTF-8 2016-07-31 21:31 GMT+02:00 David Walker : > Hi All, > > I'm attempting to get involved and hack away at some internals; I figured > the best method to do this would be to pick up a bug and do my best at it. > So I grabbed #37676. The issue asks to implement an E_(NOTICE|WARNING) > when attempting to access scalar values as arrays. cmb alerted me to a > long thread that came up last year ( > http://marc.info/?t=143379796900001&r=1&w=2). I've read over it and the > couple of other PR's that attempted to resolve this issue. > > As I read, the couple of major complaints about adding an E_NOTICE were > that multiple-accesses in a set (i.e. $a=false;$a[1][2][3];) would produce > too many errors. Matt > raised this > issue, in addition to it only being raised for non-null issues; having NULL > be an 'identity' of sort that any array access on a NULL is NULL. I agree > with him in part, and oppose in others. I think that original access to a > NULL should be treated as accessing any scalar value, however I do agree > that multiple notices would be bad. Rowan > has also > presented his thoughts to the same, and this implementation takes into > account his solution where we don't raise much. > > Christoph > countered > that: ```$o->foo->bar``` would itself raise two notices rather than one. I > would present that that behavior should be pruned itself. Object access on > a null should alert, but subsequent calls ought not to (I don't know how to > prevent that, but then again I haven't learned). > > > So I want to solicit for more discussion given previous talks. My > first-attempt RFC for this is at: > https://wiki.php.net/rfc/notice-for-non-valid-array-container > > -- > Dave > > ps: this is my first attempt here at an RFC solo, and preemptively > apologize if anything deviates from the norm too far, did my best to follow > all them how-to's. > Big +1. We came across that some days ago again. Regards, Niklas --047d7ba97ce0c0c1150538f3fca6--