Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:107034 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 18168 invoked from network); 13 Sep 2019 01:53:41 -0000 Received: from unknown (HELO php-smtp3.php.net) (208.43.231.12) by pb1.pair.com with SMTP; 13 Sep 2019 01:53:41 -0000 Received: from php-smtp3.php.net (localhost [127.0.0.1]) by php-smtp3.php.net (Postfix) with ESMTP id 6DA3D2C053F for ; Thu, 12 Sep 2019 16:29:41 -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: AS3215 2.6.0.0/16 X-Spam-Virus: No Received: from mail-ot1-x32d.google.com (mail-ot1-x32d.google.com [IPv6:2607:f8b0:4864:20::32d]) (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 16:29:37 -0700 (PDT) Received: by mail-ot1-x32d.google.com with SMTP id y39so27795377ota.7 for ; Thu, 12 Sep 2019 16:29:37 -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=s7R6WghUaXYEI2LyM0wWYa7c0b+PBb3MkC08eb/0uZQ=; b=hNFusl/pVt+tqGtcc+ch930Tp2ebf+hqDqiS1lm5QedC7FlvNMdbtEBPTePyYVxJ8a EWZ2lZCf9fI/MJ8XMfGpnWFVJs31GhjAp12itkISBqmxLYxsurbG0KBctN+e63FMh3wO XtI4c2nNYzYD1smD7seg77QBHaxtpSuWKsthcPDiNj3fDq9GGMkspTZufILTsj8isVXC V0NW3a88xKf+LcScnEMezTqFZJslJUbmYLKG98qanbgEHZS2ZsBR0gZVN2G/9+MNRE6L iaS1vaoW+fBmWn+D4E4Bdv2WLGykRbRebSBpR6ON+i3jWIKyLX0VE04XkvAHCVIxtPSE 862A== 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=s7R6WghUaXYEI2LyM0wWYa7c0b+PBb3MkC08eb/0uZQ=; b=pzZZFbEvzqLBYauX0BpqWbat/5eEamqhQ/3Ogt/9x7Wt+Dies9n+G2bVr0F4My4dhJ e/nAXzRvW70BpwrIL1ctKaOLNf2rTuQ8SVJrfko3OdgoZ9bRm5jW6JXsgf7fwkGisYmy Y7OzJ00P0vrcRdxkfRbgVajtw8dwHx0gQFWDHBI+Cp+RGh8unTtUMW3kcWUR6Sh4rlt6 JMhpeCJS/7iTWDdLHsY6vN8ptjKqi8nEBX5CTkD0HnF4l04c0CU4b2Zg2XgnmrhKdvcm 6W5q4LdDJe1yVDGtzhfQorUSrFYTDao014BjQiHZOPTiOo5dlaHKlnlPnObmlYDKjkP6 9rKQ== X-Gm-Message-State: APjAAAXKxBLB348wn9POjQg8xFULVYYx13uAm+j3rWw3ctH2T7eVMM0U 0hL1zirgYkQuB+wvfsgPu84OF6RMfzjqNaDm1u7tfUeo X-Google-Smtp-Source: APXvYqyjEm/VAg3j+Ugtvo5pSKHYNi+t51Bxoq934Qkmlb56bH9/qIeJmQJj0pbk300SDTPfXb85/KGEmk7eRivhKDQ= X-Received: by 2002:a9d:5f8d:: with SMTP id g13mr14580894oti.268.1568330977119; Thu, 12 Sep 2019 16:29:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Fri, 13 Sep 2019 01:29:29 +0200 Message-ID: To: PHP Internals Content-Type: multipart/alternative; boundary="000000000000c8129005926382ce" X-Envelope-From: Subject: Re: [PHP-DEV] [RFC] Reclassifying engine warnings From: arnold.adaniels.nl@gmail.com (Arnold Daniels) --000000000000c8129005926382ce Content-Type: text/plain; charset="UTF-8" l want to point out that way in which notices and warnings are triggered when concerning operators, is also inconsistent. Sometimes a check is done by the function of the operator (or a deeper function). Other times the operator will simply cast the operand and the casting produces a notice, warning or error. As an example; The concatenation operator will implicitly cast anything to a string. Explicitly casting it has no effect [ ] . 'abc'; // Notice: Array to string conversion (string)[ ] . 'abc'; // Notice: Array to string conversion But arithmetic operators will do a check. Explicitly casting will remove any warning or error [ ] * 10; // Fatal error: Unsupported operand types (int)[ ] * 10; // 0 "22 bikes" * 10; // Notice: A non well formed numeric value encountered (int)"22 bikes" * 10; // 220 To some extent, the inconsistent error levels come from a different approach. Even more, there is a big difference between types that can are cast silently to a non-sensical value and types where any type of warning or error is given, for seemingly no apparent reason. Changing the warning levels without addressing this issue doesn't make a whole lot of sense. - Arnold In the past I suggested operators like ??++ ??+= for this purpose. But the [? $key] is even better, because it makes it explicit which array keys we expect to already exist and which we don't. $var[$k0][? $k1][? $k2]++; This is great but the second "?" is redundant isn't it? Tekst uit oorspronkelijke berichten weergeven --000000000000c8129005926382ce--