Re: Re: [RFC][VOTE] E_WARNING on invalid container read-adccess
| From: | Dmitry Stogov | Date: | Wed, 31 Aug 2016 10:05:48 +0000 |
| Subject: | Re: Re: [RFC][VOTE] E_WARNING on invalid container read-adccess | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-95514@lists.php.net to get a copy of this message | ||
RFC proposes to emit warning, but the provided code throws unrelated "Unsupported operand
types" exception.
I see, that after few weeks of work, the implementation (just few lines of C code) is still hackish
and incomplete.
This makes me think that, the feature can't be cleanly implemented, and I vote against it.
Thanks. Dmitry.
________________________________
From: Niklas Keller <me@kelunik.com>
Sent: Wednesday, August 31, 2016 10:58:16 AM
To: Dmitry Stogov; Christoph M. Becker; David Walker; PHP internals
Cc: Nikita Popov
Subject: Re: [PHP-DEV] Re: [RFC][VOTE] E_WARNING on invalid container read-adccess
Dmitry Stogov <dmitry@zend.com<mailto:dmitry@zend.com>> schrieb am Mi., 31. Aug. 2016,
08:37:
I vote NO, because the implementation introduces more problems than intents to fix.
For example the following code starts to throw exception:
<?php $a = [null]; $c = null; var_dump($a[0][0] + $c[0]); ?>
Array access on null should always throw IMO.
BTW, I'm not against the feature, I'm against the implementation.
It's just can't be committed in current state.
I think we vote on features, not implementations. Therefore you should probably have voted yes.
Thanks. Dmitry.
________________________________
From: Christoph M. Becker <cmbecker69@gmx.de<mailto:cmbecker69@gmx.de>>
Sent: Thursday, August 25, 2016 2:49:51 PM
To: David Walker; PHP internals
Subject: [PHP-DEV] Re: [RFC][VOTE] E_WARNING on invalid container read-adccess
On 16.08.2016 at 17:55, David Walker wrote:
> I raised this concept a couple weeks ago to a couple +1's. Discussion was
> held mostly upon the PR [1], and I went through and documented within the
> RFC [2]. I'd like to go ahead and open up the RFC to voting to the scope
> that it is written.
>
> [1] https://github.com/php/php-src/pull/2031
> [2]
> https://wiki.php.net/rfc/notice-for-non-valid-array-container
For the record, the RFC rightly claims:
| The default behavior, of a silent NULL return, is not correctly
| defined in the Array Documentation however is noted in a comment
I have documented this behavior now[3], and removed the note, which was
not quite correct, because it claimed that TRUE would be returned when
array dereferencing NULL, bool or int.
[3] <http://svn.php.net/viewvc?view=revision&revision=339937>
--
Christoph M. Becker
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php