Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:119749 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 12980 invoked from network); 27 Mar 2023 22:36:37 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 27 Mar 2023 22:36:37 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 77CC01804DF for ; Mon, 27 Mar 2023 15:36:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.2 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 27 Mar 2023 15:36:35 -0700 (PDT) Received: by mail-qt1-f181.google.com with SMTP id a5so10184486qto.6 for ; Mon, 27 Mar 2023 15:36:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679956594; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=kVH2RIHa3zmXaUWFwMLfm2gFM5/v2GRbdpmJdbAyVzQ=; b=CUbih6DpkxxK0+Yy+tBnQUlQX6QfjRdAQiG9nj1KLDwCPTC3gsLre9IhqkyF1GXWIt FGuUuRN+yRVh5gu6gNsA+9ZZFVfFG5+tcSNsu0TV7Ev1Mfdjm6LrgDj6AHtPpaMDEO2J iPMzDvo9aIMB38OeQzRsA08Mbh25xi1CQWzpUiQzw0MVcgyCzyrhg2EWaLP9xQHBU12/ XdNwWXkRPaYPdwXPCcVVqvhtu0SC9zZzT7WuzIQ/BIL1e0B3LCP8et2+csBRnPvbM8pF 6XyrWTVSwBekFXlr14bnF+yMtutd57WIAHIUnx8YdEwKE13B7b4wXO3FKwpYDFbfEw18 mvdg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679956594; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=kVH2RIHa3zmXaUWFwMLfm2gFM5/v2GRbdpmJdbAyVzQ=; b=pjpxGTkHceV8KPmAvspxZiUUHBgVZ/oisANQRz8wHN7Q1tHPLjBTDxrrWycZdcOQr4 +Sub5oAGwy+OmlN9arGzSBKERPq3FAmyv3iIDpT/nM/dpl3pUBSEUBQcJ1r7+5/MFkAp sHEaOfm6hStsIDl80+C2JNde0qbqUp0pYH+sq5G+agm9SPZuo4TAW6Sf439Nn218JGQZ 4/xkapnwFA0tGtHiZCkXkHV5uFq+St+pOPMPipP/k+AiYU/Q5XaYKXcxhgt5dXlx7+Vj 0rBPKU0QsbGWoZi5QZ8pw8GoR/FsZR3ZSjpmo39B16D/1SBG65AZ/KPu8CfmB6Iqj/sG aVkA== X-Gm-Message-State: AO0yUKWt0Bv1zf7QxBhdaTc3u5LVcGxc0VLb6T0BSHY09mXZ/L/wTwLf +TTdt/27fCDa0NHVi0k1WixeVyOJPR3uUgsySWLLyqnTEJg= X-Google-Smtp-Source: AK7set+zNZS1wIEeYLxuk1kL90pCZKPJlgPEUcFWMXb701zbXCNrlN+MgGpXDfg1R+vh0kRghzsL8QVgB2rhNF7bclA= X-Received: by 2002:a05:622a:24e:b0:3d6:2cd9:74e6 with SMTP id c14-20020a05622a024e00b003d62cd974e6mr5222755qtx.9.1679956594487; Mon, 27 Mar 2023 15:36:34 -0700 (PDT) MIME-Version: 1.0 Date: Mon, 27 Mar 2023 23:36:21 +0100 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary="0000000000000d759e05f7e960e3" Subject: [PHP-DEV] [RFC] Define proper semantics for range() function From: george.banyard@gmail.com ("G. P. B.") --0000000000000d759e05f7e960e3 Content-Type: text/plain; charset="UTF-8" Hello internals, While working on analysing the impact of the changes proposed by amending the behaviour of the increment and decrement operators ( https://wiki.php.net/rfc/saner-inc-dec-operators) I discovered that the range() function has some rather lax behaviour that is very unintuitive. I therefore propose the "Define proper semantics for range() function" RFC to address the unintuitive behaviour that sees no usage and/or hide bugs: https://wiki.php.net/rfc/proper-range-semantics The change propose to throw TypeErrors and ValueErrors for case where I couldn't find occurrences in the wild and hide bugs, and emit some E_WARNINGs for cases that are hard to detect via static analysis. Best regards George P. Banyard --0000000000000d759e05f7e960e3--