Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:95579 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 75800 invoked from network); 2 Sep 2016 15:42:45 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 2 Sep 2016 15:42:45 -0000 Authentication-Results: pb1.pair.com smtp.mail=dave@mudsite.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dave@mudsite.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain mudsite.com designates 209.85.213.43 as permitted sender) X-PHP-List-Original-Sender: dave@mudsite.com X-Host-Fingerprint: 209.85.213.43 mail-vk0-f43.google.com Received: from [209.85.213.43] ([209.85.213.43:34804] helo=mail-vk0-f43.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D4/8C-19490-FED99C75 for ; Fri, 02 Sep 2016 11:42:41 -0400 Received: by mail-vk0-f43.google.com with SMTP id v189so26574345vkv.1 for ; Fri, 02 Sep 2016 08:42:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mudsite-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=O3/S+8vuN7L3qM5/zu0RWvpKLGs0eyn0T2R59L8e3CI=; b=BzNkJpb4dhyqXEBPsdpZ5DG+tL4xovgozCC4tD/iBifFWcuBWZvBrqjTViOQRWHDb8 mg5Zed3DrT52uwn/OOmva7sCTepxeGsSfgXvKo2tutk9G7jBxB8S0KA+MlJLm0VZb7uk 6gw/ciug7Bqg2YA36ILhZDYoWJ+wDjligSmc7EJSqXEmQbAhDwBjhUrWkfEuBRqVLgo+ BJS5p5q+XTd+2SQM7Rf1EE8b0RM/Du6AYTOAfh1fnGapSZi+WOurf50hzXbdDBCVdVsI O1PQQOZW/wjR4pLeHbbdqCrc5FJfAJ9QqmiptVxd2F6hS/J8rYaDUEH+mm6Cm9dlgUWm JYxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=O3/S+8vuN7L3qM5/zu0RWvpKLGs0eyn0T2R59L8e3CI=; b=UFcm1r09vRjZqHSHGg50BAP6JCZNPdO2V7THmJQjBAOGyux3ZDSYwXfkrZ7p9v6EXV 1LngvuDMIZ1wHtPCQrQyAtFgMUZ/6dVr9y0FvGOckWeBzba7hU1rbBGS/WKalM0392+6 7UrLeJIqiv+55cD8G05VTiTGqqmh3W+6HAXcuWaDDEour1elO55h8L/BbSZRxenFUWP9 EGDZF0cn5/fRCn5vbBe/tOkgZ75527vjOpjqQyg7P+KpHmMvB3k0iwejGUW3KrsSFA8o T4FAGwSf0m+YqHkaC35Nlt74ETGMwPTp5OTgKwCmZLMii41ewv2b7g9WSXdkk2QjDn3E fcuQ== X-Gm-Message-State: AE9vXwO4AOg9pamlSkiBFRzRetoY+YY8V1oPxVqBKLrd23yrZZ05nGPLzR+lLnWm/wXAjXm1jwIViG8Few+tHg== X-Received: by 10.31.4.85 with SMTP id 82mr13991040vke.155.1472830955692; Fri, 02 Sep 2016 08:42:35 -0700 (PDT) MIME-Version: 1.0 References: <1e6cac8a-e1af-c9e7-a900-a2efda0771dd@gmx.de> <7eb5f710-b34d-743a-3563-4e74e5995d41@gmx.de> In-Reply-To: <7eb5f710-b34d-743a-3563-4e74e5995d41@gmx.de> Date: Fri, 02 Sep 2016 15:42:24 +0000 Message-ID: To: "Christoph M. Becker" , Dmitry Stogov , Marco Pivetta Cc: PHP Internals List , Nikita Popov Content-Type: multipart/alternative; boundary=001a114288fcedb509053b882d76 Subject: Re: [PHP-DEV] Re: [RFC][VOTE] E_WARNING on invalid container read-adccess From: dave@mudsite.com (David Walker) --001a114288fcedb509053b882d76 Content-Type: text/plain; charset=UTF-8 On Fri, Sep 2, 2016 at 9:28 AM Christoph M. Becker wrote: > On 02.09.2016 at 16:57, David Walker wrote: > > > Poking around, I'm must not be understanding how TICK opcodes would > > negatively impact the lookahead. It may be my newness, but the way I'm > > reading the compilation of ZEND_AST_DIM, would not be suspect to random > > TICK opcodes from impacting the lookahead. I see that for a single > > ZEND_AST_DIM, compilation will recuse emitting all the FETCH_DIM_R > opcodes > > for it in succession. Whereafter, a subsequent call to > zend_compile_stmt() > > will emit the TICK if it was declared. It could also be that I'm unsure > > what a test example would be that could inject the TICK into the middle, > of > > the DIM compilation. > > > > The same applies to the BEGIN/END silence, as they will be wrapped around > > the entire compilation of the DIM opcodes. [1] has an example using both > > ticks and silencing, which seems to work as intended emitting a single > > warning (for the un-silenced access) > > > > I'm not exactly sure what you mean by debugging-opcodes here though, > > however, unless someone is hooking into the compilation and compiling > DIM's > > in a different way, I don't see the inherent problems with the lookahead. > > > > I was thinking about the use of an exception, however, I think that'd be > a > > pretty significant shift. It would also be very odd that this case would > > be the exception throwing one, whereas accessing via reference wouldn't, > or > > any of the undefined indexes wouldn't. It would also impact most user > code > > out there by needing to wrap variable array access in a try{}catch, which > > would be imposing a pretty large change to php 8.0. That's why I didn't > > really think shifting to an exception would be appropriate here. > > > > Thanks > > -- > > Dave > > > > [1] - https://gist.github.com/bp1222/18d80e8ec962eba1ba75c99124191a0a > > I don't understand why we're even trying to hack this, let alone > considering to throw an exception. Why don't we handle array > dereferencing just like property access, which also might throw multiple > notices, see . If this is considered too much > of a BC break for 7.2, we still could postpone that change to 8.0. > > -- > Christoph M. Becker > Christoph, I somehow remember this being raised at some point during this RFC, although I can't seem to find where now. I'd offer that it shouldn't be doing that. I would be of the opinion that when an error condition appears, it shouldn't cascade the errors onwards. As such, your example there, I'd desire a single notice raised. FETCH_OBJ_R could benefit in the same way I'm attempting the lookahead to FETCH_DIM_R. Although, I'd be open to raising errors if that's what's preferable. Thanks -- Dave --001a114288fcedb509053b882d76--