Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:107362
Return-Path: <nikita.ppv@gmail.com>
Delivered-To: mailing list internals@lists.php.net
Received: (qmail 79754 invoked from network); 2 Oct 2019 15:43:21 -0000
Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12)
  by pb1.pair.com with SMTP; 2 Oct 2019 15:43:21 -0000
Received: from php-smtp3.php.net (localhost [127.0.0.1])
	by php-smtp3.php.net (Postfix) with ESMTP id 06B792D1AA9
	for <internals@lists.php.net>; Wed,  2 Oct 2019 06:24:15 -0700 (PDT)
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp3.php.net
X-Spam-Level: 
X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,
	SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.2
X-Spam-ASN:  
X-Spam-Virus: No
Received: from mail-lj1-x236.google.com (mail-lj1-x236.google.com [IPv6:2a00:1450:4864:20::236])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by php-smtp3.php.net (Postfix) with ESMTPS
	for <internals@lists.php.net>; Wed,  2 Oct 2019 06:24:14 -0700 (PDT)
Received: by mail-lj1-x236.google.com with SMTP id a22so17114728ljd.0
        for <internals@lists.php.net>; Wed, 02 Oct 2019 06:24:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20161025;
        h=mime-version:references:in-reply-to:from:date:message-id:subject:to;
        bh=nGFtbOcxQyV00DBDQ8+0nrTblORDt5N7yRE8ruVhIz8=;
        b=UFJgfC8C0CxRQBL2YFly/AS5Z8vlpQuMRqW9H/+IJ1bOxZiDISdTX59WUVaYdP/tz3
         6BPguR88/T+zkfus24x5EUHslIqP0vq24CNleGICSmCIjdVDJf+38er5nZkF4u99M17w
         TodwoH8IFmHF/FzHwaeub3LtHvks21lR0ubHmGSbTcxnTiAFFbgr4W7gSLBhacYeX+FR
         Oc8FMdkiPEmAc40CkBEvffAKoWyaIuH3HJDescjmdsdQOctECFcJ6dFNXhDjMRZ1+ywb
         NuskQgniFe/MjH430rUSwo4s8QdSEbA0GejD67ljfvigy0ApsKg3RHPgpOI5wUcON2EU
         MaAA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to;
        bh=nGFtbOcxQyV00DBDQ8+0nrTblORDt5N7yRE8ruVhIz8=;
        b=CKVNrbAGP+FJ9ZvrJ58l90qSrtRkxCDamhmZZO9ViPY7Gu8rg5rhw02gNde6+57PRt
         Kf8+OkfCNQApJQLmo12S8Z+VAa3dRN8YGjcjjEN3EE23c/aMu49fnXo99vVD/TqLqk0b
         vm81I6jqvo30aTaiOjjdxLHXKcea+HEle5APa9YVL4jrtW1ufcaE3pW0EtQceGhnBfVi
         v0T4FUcZshZCo7GRNLzBGhn1Wvt/Y4bfDgTYwC2CdDKtgSMI55mU2kBFNZDWkGdDwZsV
         l2sENMnl8ggmp568m3srPPtoiG+CApch37HPcw/x7YIsawsS+CEQSs26S7w5piEU3rk0
         Dv/w==
X-Gm-Message-State: APjAAAWOvXFemCZhxqqgOynH8O7pxrMkZjsZJN+5Yeh5/PcLK/qTYRxG
	Vys1AIuOQS490AhuMxDig6nRs2XL10fZgxdRjYolIdutsxg=
X-Google-Smtp-Source: APXvYqx1HH7zWF0EinhcuK529mR24+HUVxhNNsKY000eZOl38/vS1g3Ga4bdx7d6120KbBzXZ+gSFFRkimOFjaC/Oss=
X-Received: by 2002:a2e:7a16:: with SMTP id v22mr2535339ljc.61.1570022652734;
 Wed, 02 Oct 2019 06:24:12 -0700 (PDT)
MIME-Version: 1.0
References: <CAF+90c_Ds+UNZB4hAi1989SRafb=d1JkP2q4pdwkUUXfcHrLCw@mail.gmail.com>
 <CAF+90c99w6Uk+P8rm_p0Pd3iKsBKQqAbBjs2Zzwb5vGW9-snhQ@mail.gmail.com>
In-Reply-To: <CAF+90c99w6Uk+P8rm_p0Pd3iKsBKQqAbBjs2Zzwb5vGW9-snhQ@mail.gmail.com>
Date: Wed, 2 Oct 2019 15:23:56 +0200
Message-ID: <CAF+90c9zAggYVeU76kgJydmNr3nzN2wKgOjTz3QF7yohJLQCOw@mail.gmail.com>
To: PHP internals <internals@lists.php.net>
Content-Type: multipart/alternative; boundary="0000000000008172830593ed62c2"
X-Envelope-From: <nikita.ppv@gmail.com>
Subject: Re: [VOTE] Reclassifying engine warnings
From: nikita.ppv@gmail.com (Nikita Popov)

--0000000000008172830593ed62c2
Content-Type: text/plain; charset="UTF-8"

On Thu, Sep 26, 2019 at 9:41 AM Nikita Popov <nikita.ppv@gmail.com> wrote:

> On Thu, Sep 12, 2019 at 2:17 PM Nikita Popov <nikita.ppv@gmail.com> wrote:
>
>> Hi internals,
>>
>> I've opened the vote on //wiki.php.net/rfc/engine_warnings.
>>
>> There are 4 votes, all of them independent. The first 3 are for specific
>> cases that were controversial during the discussion, the last one is for
>> the remainder of the proposal.
>>
>> Voting closes 2019-09-26.
>>
>
> Voting has closed with the final outcome being:
>
>  * Undefined variables: 36 exception, 18 warning, 10 notice. Exception
> declined with 56% in favor. Warning accepted with 84% combined majority.
>  * Undefined array index: 42 warning, 21 notice. Warning accepted with 2/3
> majority.
>  * Division by zero: 52 exception, 8 warning. Exception accepted with 87%
> majority.
>  * Remainder: 54 yes, 3 no. Accepted with 95% majority.
>
> Regards,
> Nikita
>

This RFC is now mostly implemented. The parts that are still missing are:

 * Switching to DivisionByZeroError. I would like to add an fdiv() function
before doing this and have started a separate thread on the topic.

 * The "Invalid argument supplied for foreach()" case. Christian Schneider
has requested that this stay as a warning, and personally I'm okay with
doing that. Unlike most of the other exception promotions, this one won't
result in any VM simplifications/optimizations and I don't have a very
strong reason to make it an exception. Does anyone else feel strongly about
this?

 * The "Undefined array index" case. This one passed the vote with an exact
2/3 majority, so I'm a bit uncomfortable making changes here. This is also
the only case where convincing usability concerns have been brought
forward, primarily around the $array[$key]++ example. I'm not yet decided
on what to do here and whether we should pursue additional library or
language features first.

Nikita

--0000000000008172830593ed62c2--