Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120310 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 81858 invoked from network); 16 May 2023 12:29:58 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 May 2023 12:29:58 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C484D180083 for ; Tue, 16 May 2023 05:29:54 -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=-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_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-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (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 ; Tue, 16 May 2023 05:29:54 -0700 (PDT) Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-643a1fed360so8709874b3a.3 for ; Tue, 16 May 2023 05:29:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684240193; x=1686832193; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=NX8nG2s//+kYAqBrcls9Dl9pQ87FkPz57mjsTRlfqXw=; b=myhLyXxWaWpIUKANeZGJgOiAJ8wjK0/8Hj0N1+Ha1kILbQBQB+b5Ikqo/bXK6gUH22 3eL8SnDoUdjxGl7HJQCUYnX1yFnr1ndt5Y0Rg76WM+Ncf1UMPZ5DmrvUQy0Nr5YOzCtP Q5Q4VYgbK/UvEs1tBbZju+DrKq2gJwkQcCHq0gBDkVxQ284ti/1kvMUlCNrowYJ5Ljif o7Ygx6mep8AIM6Od7Vr86G8ZxSLdWg3dpZYXQvnn9EWboYuAvuAjCtE0YhlixE0l9uLz kgOIeOFz8h5lxHQziaZzlMQ3TxbF/xEJuEY0o3Ui8/402prFl2VbIK/szrn/ppJUP3o8 aIyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684240193; x=1686832193; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=NX8nG2s//+kYAqBrcls9Dl9pQ87FkPz57mjsTRlfqXw=; b=WkKh0U2svhUPWUXrKgfQi2mb8JnN8Ul4Jpg35qtiWdjfLua6PdiI+mfuqEzVqI5iTC 0zg019EJS1DA+Hf6+l1ocbtwQ+YVyJMOSpAC3IjVMxHbGsPkoGZc2OVidtSPkSZq2Sqs LPz94zckrlIRsB7EfCmopaWNMxFH+vPBQesknBcdI8tDaTFwRM8txYr8ywFl7doj1XyV M1Sc3CSw/0ukadj6tpl4lp495Gy+Uq3FM6nwkyLATkCTw0ApTlCoBwwQgIsMzHUAlp8s Ur1z3gmFGllLgVEmgTSaipBk40j0fOO8lElCwv+1j1v/fn7ZmkkZvNdiaJs+M7IGVp8T T3Nw== X-Gm-Message-State: AC+VfDyEuWQvL9fnlKgre2i3BNEXN3N6PPiKmBKPuPamSI172GqFtwIE vnIuNcKMAp0QdjjT5luHIQzyrsGwfIWdZxo/ZDs= X-Google-Smtp-Source: ACHHUZ53G4W6n3BHRc5b+pAzcc2zHh9bnj7Zoeno+IWxp8xQgC0HRY+Dwdq7Fot2lRTNfDqWdzdivVvLbhK2SheAvzA= X-Received: by 2002:a17:902:b70d:b0:1ae:2e08:bacd with SMTP id d13-20020a170902b70d00b001ae2e08bacdmr3615359pls.14.1684240193232; Tue, 16 May 2023 05:29:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 16 May 2023 13:29:41 +0100 Message-ID: To: Jorg Sowa Cc: PHP internals Content-Type: multipart/alternative; boundary="0000000000006f21f705fbceba7d" Subject: Re: [PHP-DEV] [RFC] Define proper semantics for range() function From: george.banyard@gmail.com ("G. P. B.") --0000000000006f21f705fbceba7d Content-Type: text/plain; charset="UTF-8" On Mon, 15 May 2023 at 23:53, Jorg Sowa wrote: > Hello! > > I have one concern about the part: > > > Emit an E_WARNING when $start or $end is cast to an integer because the > other boundary input is a number or numeric string. (e.g. range > ('5', 'z'); or range ( > 5, 'z');) > > Doesn't it limit the functionality of the function for the numbers as > characters? Currently when we call range('/','z') we get full range of > characters. https://onlinephp.io/c/9cb12 > > But when we change argument $start to next character which is zero ('0') > then we get array with only one element. https://onlinephp.io/c/a0cda > > Casting numerical string in this function may be confusing. > > Sorry for making fuss just before voting, but didn't see this topic before > and wanted to share my insights with you thinking it may be relevant. > No worries, this is the point of giving a heads-up. Someone else brought this to my attention again as well. And the concern makes sense, I've updated the implementation and RFC to adjust the behaviour with string digits: https://wiki.php.net/rfc/proper-range-semantics Please let me know if this addresses the issue and is also clear. Best regards, George P. Banyard --0000000000006f21f705fbceba7d--