Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120317 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 10581 invoked from network); 16 May 2023 16:49:50 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 16 May 2023 16:49:50 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 38269180503 for ; Tue, 16 May 2023 09:49:49 -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_H2,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-lj1-f169.google.com (mail-lj1-f169.google.com [209.85.208.169]) (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 09:49:48 -0700 (PDT) Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2ac80da3443so155656481fa.0 for ; Tue, 16 May 2023 09:49:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1684255787; x=1686847787; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=CKgNSWOvq2WiTfmNxVtumZfRVSoe1738eiyCNIz0HIA=; b=JZmGo/EzvvDnCnTdcOs/evuIaL41oV1aeLPLkgDVwxFhvVJDGWuSwbAzjtGiFex5Ys iiN9z9uhJLIHPaHcgSc7X5sBeXW/XYMoY0JEq/SGofSkjFuwGktbVIgD9BLps+P1DwFL Vz0slJz79g+PyFXx0m3PcDvrzmJw2agrw0cD1l9lnRLjKVta639rCALBspqSgJayMMFn 8c+qFevvNpXLNo3BdmSkX/+0TLL3cIkomERtRYbg9zlmxF0f3C/at+Wox5rrijEQXiuu TxovwADjUhA4ywByvvQgGpXNxEV9H8cVJ9niOygpAflvflVY89rgdjkQEeio25eARaCk N3jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684255787; x=1686847787; 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=CKgNSWOvq2WiTfmNxVtumZfRVSoe1738eiyCNIz0HIA=; b=ALbM6k0HSN6K/IRIAJLjKxHSBM9T9S/k7Jp7mqwTSakC7AX6ehtgcegWG1jGRZsRFJ ic5q0UAlVdazI/3RKGdDNCbBHxypFRdllulJGQiby2VyRIY0MkN/S2m9rDdMO5WA3gMI 0nKFibTdRKuUI8lAF9T0izMcsHR+f5J6sfbIS6328Qv/8pUfeK2E4HfrPNgKQ+rNHWOL 5rAF6jZa6FepebyYk1ue/leS1Fr1yn4bKlAUIlPlewr54H57pHEzRYECMFcgzjxelzez xzXBIVrq0+6ANi8YBA+TGDnlffFo69l8pYibSqoXWGjidIt63NMKZwfHI6v6GSoVlySo G3og== X-Gm-Message-State: AC+VfDxzAQCSHWpY2yauoPLFImZUKajLhMIjkFzMnY1A7GdIQU8kUQfH 51UeMrEf4ELE0vDG6uWe1hlA1z9nmUp19rwtg2A= X-Google-Smtp-Source: ACHHUZ4FwaOxcZX7BdzPvP5jahWnhuw9YNCbi+ixUIgI12sFo6M/l65RqSQ3BaAh4ALSM32iljfqGwU8g9+3yzk8VfY= X-Received: by 2002:a2e:818c:0:b0:2ac:8402:2eca with SMTP id e12-20020a2e818c000000b002ac84022ecamr8965463ljg.28.1684255786416; Tue, 16 May 2023 09:49:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: Date: Tue, 16 May 2023 18:49:35 +0200 Message-ID: To: "G. P. B." Cc: PHP internals Content-Type: multipart/alternative; boundary="000000000000dc3f5e05fbd25b9e" Subject: Re: [PHP-DEV] [RFC] Define proper semantics for range() function From: jorg.sowa@gmail.com (Jorg Sowa) --000000000000dc3f5e05fbd25b9e Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thank you. That makes sense. I have last question about case with integer and string digit, i.e. range('5', 10) or range('1', 9). What would be in this case expected output? I couldn't find any test cases covering this example. Kind regards, Jorg On Tue, May 16, 2023 at 2:29=E2=80=AFPM G. P. B. = wrote: > 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 relev= ant. >> > > 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 > > > > --000000000000dc3f5e05fbd25b9e--