Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:108801 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 30445 invoked from network); 2 Mar 2020 11:04:24 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Mar 2020 11:04:24 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AB96D1804D8 for ; Mon, 2 Mar 2020 01:23:15 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-il1-f178.google.com (mail-il1-f178.google.com [209.85.166.178]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 2 Mar 2020 01:23:12 -0800 (PST) Received: by mail-il1-f178.google.com with SMTP id q13so2546921ile.8 for ; Mon, 02 Mar 2020 01:23:12 -0800 (PST) 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 :cc; bh=E7CjYF+y4qNlfQSpp/04eC6eSAiptuqFx9pCrKqd+ho=; b=CT5NIS7y3vju4VGt285qk5yyNy/NIsXCQMTpx6QHwLsBrFxJLY6i+0/h2dB1lAyVy4 h81KjXXRSw4UDALnKV0jO05GqCaIa54dKVj7iwj8m1z//vDwTwHDfcTMzMS2/tIv0+vk rpId8dlscG4UmF6UvtFT4p3sMcEq50VUZqia0cUwdI4w2UoclXF1U9RI2GcKCrCVXx4B yGpxsrDtPRZhax/9Wx/X/iPuJgakOA0ogTPZzPte4XM5YFeEh2H5E9ion2rU+2E3IjAd N9wgYisosS7UXHyZQJg4SbBRCX1DMPTjfs0274oHXGVCeo/H1Xk2FTl6ihAmKxgtHLFP 2hBw== 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:cc; bh=E7CjYF+y4qNlfQSpp/04eC6eSAiptuqFx9pCrKqd+ho=; b=gRzGaXvl2pX/3DFGgONhVv4EXhdlPF8Z45MvmoaTO9TcFS8JAaxMeofPq44dWpWxIb 9EedZZTuHrVzUnk6LF9XawKJu1TlC2hubjzO7Wieq43dP3rjNC+LmpEVjwcC2wSC0V21 RRd6NvZn3GATO8m2ixE8DNsF6+fNvaCgk33WPo+tmrRs2HIn+uMPkYCZB1nOr0tDoSp6 hutaR5nOTNDr1GFfBFqGlxANm/MP6NlAkhOGoB5+skYL7fvM9/4BsasK/KRTucB3V+1f 8+zCc4COpkEPEOqEPUe3scbuum7JidJa4LNVcPyQYTCbCees7UGeXXdMBkVfArrCN2dT qEwA== X-Gm-Message-State: APjAAAWTz1RXpjR4tBicnbeCQ9kCtwJ2bwrMlmWBiYqrUPoUG2sZ29Ah HiPKQDwJ2m9tEDJXJOYaOVO75aKOURIg4xUBhBg= X-Google-Smtp-Source: APXvYqxSflM92+M8fcQkjCQ8o4JhaSPTAULDhLLMsZ02HrqGHI1O+cRwrVoAyTyoitabeoj+StIh7Rtcj4GaQ6LZHRM= X-Received: by 2002:a92:1d1d:: with SMTP id d29mr14544404ild.66.1583140991725; Mon, 02 Mar 2020 01:23:11 -0800 (PST) MIME-Version: 1.0 References: <3f615d82-a84b-697b-5c02-8d915270f92c@gmail.com> In-Reply-To: <3f615d82-a84b-697b-5c02-8d915270f92c@gmail.com> Date: Mon, 2 Mar 2020 11:22:57 +0200 Message-ID: To: Rowan Tommins Cc: PHP Internals Content-Type: multipart/alternative; boundary="00000000000070f879059fdbbc29" Subject: Re: [PHP-DEV] [RFC] Increment/Decrement Fixes From: drealecs@gmail.com (=?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?=) --00000000000070f879059fdbbc29 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Rowan, Thank you for the effort, very good unification of behavior across increment and decrement operations. I would say that all 3 points are most probably code issues and potential bugs. I agree with all of them. For point 3, the new behavior is an error. The problem will be caught earlier in any production code. For point 1 and 2, both the old and new behavior is silent. Can we think of a safer way to migrate? I'm thinking about having a special notice that can be used before changing the behavior and code running an old version could have some handler to catch it and at least be aware of the change. Have a mechanism like this ever been proposed on internals list? The "special notice" I mentioned could be something like an information debug behavior that can configuration for each debugging type statically in ini settings, used before parsing and have no impact on production code when disabled. New debugging types can be added in patch versions for older PHP version (now 7.2, 7.3 and 7.4), preparing for minor/major BC changes and removed after migration (now 8.0). When upgrading production applications, I always wished to have something like this available for BC changes. We even consider recompiling PHP with some changes here and there where it would have been harder to find the issue statically but we didn't go through with it. We can even do it back for BC changes 7.2->7.3 and 7.3->7.4. Let me know if this would be a good idea and I can start a topic on this as it has nothing to do with this RFC. Regards, Alex On Sun, Mar 1, 2020 at 11:23 PM Rowan Tommins wrote: > Hi all, > > Following my thread a couple of weeks ago, I would like to put forward > an RFC to fix some inconsistencies with the behaviour of the ++ and -- > operators: > > https://wiki.php.net/rfc/increment_decrement_fixes > > Note that this RFC focusses on three specific cases which I think could > be considered bugs, but require breaking compatibility: > > 1) Bring the behaviour of decrementing null in line with subtracting 1 > (and with the equivalent increment operator) > 2) Bring the behaviour of incrementing or decrementing true and false in > line with adding or subtracting 1 > 3) Throw the same error when incrementing or decrementing an array as > when adding or subtracting 1 > > I believe the behaviour of strings, objects, and resources, each raise > sufficient extra questions that they should be left to future RFCs where > we can focus on each in more detail. > > Please read the RFC for more detail on what is and isn't proposed. > > Regards, > > -- > Rowan Tommins (n=C3=A9 Collins) > [IMSoP] > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --00000000000070f879059fdbbc29--