Re: [PHP-DEV] [VOTE] Reclassifying engine warnings

This is only part of a thread. view whole thread
  107325
September 26, 2019 08:31 cschneid@cschneid.com (Christian Schneider)
Am 26.09.2019 um 09:41 schrieb Nikita Popov ppv@gmail.com>:
> * Remainder: 54 yes, 3 no. Accepted with 95% majority.
Just for the record: The one I'm most concerned about here is the foreach on undefined variables throwing an exception. While this was already promoted to a warning at an earlier stage it still allowed a program to finish with a well-defined result (looping over nothing does nothing). Now this code will stop with an Exception and possibly won't produce its output. I noticed this before the vote but as the mailing list was already flooded with the 'undefined variables' discussion I feared that there was no place to bring this up without getting personally attacked like I was for the undefined variables stuff. Anyway, the vote is done, I said my piece and will shut up about it now, - Chris
  107335
September 26, 2019 14:23 chasepeeler@gmail.com (Chase Peeler)
On Thu, Sep 26, 2019 at 4:31 AM Christian Schneider <cschneid@cschneid.com>
wrote:

> Am 26.09.2019 um 09:41 schrieb Nikita Popov ppv@gmail.com>: > > * Remainder: 54 yes, 3 no. Accepted with 95% majority. > > Just for the record: > The one I'm most concerned about here is the foreach on undefined > variables throwing an exception. > While this was already promoted to a warning at an earlier stage it still > allowed a program to finish with a well-defined result (looping over > nothing does nothing). > Now this code will stop with an Exception and possibly won't produce its > output. > > I agree. At the very least, I'd propose that null (and ideally false) NOT throw an exception. There are enough instances of methods that return one
of those values when there is no data (so, not an error situation) but an array when there is.
> I noticed this before the vote but as the mailing list was already flooded > with the 'undefined variables' discussion I feared that there was no place > to bring this up without getting personally attacked like I was for the > undefined variables stuff. > > Thanks for bringing this up. I think this should be noted in relation to the other RFC currently out there. Those of us speaking out against this
RFC are the ones being held up as examples of why that RFC is needed, which this statement actually shows that it was those in favor of the RFC that were behaving in a way that intimidated others and made them feel reluctant to contribute.
> Anyway, the vote is done, I said my piece and will shut up about it now, > - Chris > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >
-- Chase Peeler chasepeeler@gmail.com