Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106964 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 35762 invoked from network); 12 Sep 2019 17:14:09 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 12 Sep 2019 17:14:09 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id BDEA52C88D3 for ; Thu, 12 Sep 2019 07:50:04 -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,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-vs1-xe2f.google.com (mail-vs1-xe2f.google.com [IPv6:2607:f8b0:4864:20::e2f]) (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 ; Thu, 12 Sep 2019 07:50:04 -0700 (PDT) Received: by mail-vs1-xe2f.google.com with SMTP id s3so16358364vsi.12 for ; Thu, 12 Sep 2019 07:50:04 -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 :cc; bh=8MjzVyLYBR2Aaqv7SWNsfcHyxp3sq4f4fP9lJXLDgWQ=; b=VCReHN4zjcYsaBK8GIy4OAtIqAYLgUZI48RyofT7NlHXQYgmaPxYbI9qCvowu3jfIZ HxA+HPrqxegkI1H6/Nz3u1jXKicX4XLamXbXpJy+W7hSq9wEOarLpvH43P7sw2pMvJjV U/f+T7p3UYLjbThHyp8OfuzMmDWPWizbFtKmOuQ3kMmVdeC7/UOO0rIzkn61zSfre1uu oSFzjmmvQrGf0AxIabb+dGofmzBogxZHyDJ7B6vk+hu+tQzxbYO/uCHZGty3+LH/NLtf 007z3EpDNjNTeCHQcxc6/Fot38ixUKXwX/+mUK5gW9JBTo3u5rqoOWmatINDEKPB1ucE 20xQ== 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=8MjzVyLYBR2Aaqv7SWNsfcHyxp3sq4f4fP9lJXLDgWQ=; b=dkqQZATz4kmN7SQM44S0O74zv9T4FJtOSAZTiGlB2McIHb/3ml1ZDcBI3pHtmFPA9O w1+IIIGvQnnfU5KznQZPGosIZhOSTHpYqUgsIH0ay/wx5PjMi06FixTyAHmUCfKN7hfH sERntwDIsd8y/k6gRJpQNIjAXUMU++qMgBax5oWPVoIfgu0OinFXItyTKpijob3C08u9 FDAYtgmO+g8eC0IjvOf32mRhsJOMByI1MS6s67tSu+Yf0+NUf/M2N1X4XZ92/CbQjByf sYHK5sOAMYHD2dFXNN9DEbUCwmQmEgiEwvNO1yBVkIOVsM2mG25tvzvVi2OMylJbOTpn sNbA== X-Gm-Message-State: APjAAAXtmAe5PfB9mEsbBKxpXTQUHCvRcbUxDkczJ13wK9B6BzS+Zt7r h48Uj+KAEQ1tZl4LDI0CKKlA53MbylbqNC2sQ7k= X-Google-Smtp-Source: APXvYqxOd6Iizl1smyHv+zbywBIHfHLmfyJJEQBy+/04vLR2kgKeqP9YCGb3LFm2X/bFPvZiNMMcxaqXysZa234AGsM= X-Received: by 2002:a67:ec14:: with SMTP id d20mr23418046vso.209.1568299803569; Thu, 12 Sep 2019 07:50:03 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Thu, 12 Sep 2019 10:49:52 -0400 Message-ID: To: Robert Korulczyk Cc: Rowan Tommins , PHP internals Content-Type: multipart/alternative; boundary="000000000000b172df05925c4024" X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: chasepeeler@gmail.com (Chase Peeler) --000000000000b172df05925c4024 Content-Type: text/plain; charset="UTF-8" On Thu, Sep 12, 2019 at 10:43 AM Robert Korulczyk wrote: > > But, if you're dealing with a counter, then, the intent is that you are > > going to start counting at 0 and increase it. > > This is not that clear as you may think. Several questions may come to > mind when you will see incrementation of non-existing variable/key. Is it a > bug > and this should be initialized with a different value than 0? Maybe a > mistake on copy&paste? Maybe a typo? > > One additional line will make your code much more obvious and easier to > read and understand: > > $i ??= 0; > $i++; > And I'm totally in favor of writing code that way. What I'm not in favor of is breaking all of the existing code that doesn't do it that way and works perfectly fine because some people want to FORCE everyone to write it that way. > Your code is not only for compiler/parser, but also for humans. Expressing > your intentions clearly is important - the less ambiguity the better. > > Regards, > Robert Korulczyk > -- Chase Peeler chasepeeler@gmail.com --000000000000b172df05925c4024--