Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:106962 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 32153 invoked from network); 12 Sep 2019 17:07:38 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 12 Sep 2019 17:07:38 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id A53E42D1FFD for ; Thu, 12 Sep 2019 07:43:32 -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,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS57367 213.189.55.0/24 X-Spam-Virus: No Received: from cache4.mydevil.net (cache4.mydevil.net [213.189.55.195]) (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:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=korulczyk.pl; s=devil; h=Content-Transfer-Encoding:Content-Type:In-Reply-To :MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=mRvB9uZNFBe/uyxGUdtFLB07jyVpfRehR9yfgrm5zKQ=; b=idf2KuzCnNyNsDxYsMOIubSqwW nwsdYSJcnxrrqHwigUI+b/LHlHsl82HrxuNW+0MD/hUz56HetPxf8DILFEI8cvZvX53Be1zsQhwTo 4L7XH8D/qAKctEwQ/zsy4VLhtxxlqgwYJSYXJE4myEVnqrbNSAwyXZzm+MFmw+ol0TAA=; To: Chase Peeler , Rowan Tommins Cc: PHP internals References: Message-ID: Date: Thu, 12 Sep 2019 16:43:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-AV-Check: Passed X-System-Sender: robert@korulczyk.pl X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: robert@korulczyk.pl (Robert Korulczyk) > 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++; 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