Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:118307 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 94403 invoked from network); 29 Jul 2022 03:16:38 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 29 Jul 2022 03:16:38 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 5A98418037E for ; Thu, 28 Jul 2022 22:15:20 -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_20,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-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47]) (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 ; Thu, 28 Jul 2022 22:15:20 -0700 (PDT) Received: by mail-wr1-f47.google.com with SMTP id u5so4662752wrm.4 for ; Thu, 28 Jul 2022 22:15:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=ve07Nts2a3v0zoJpH01LCZ1zcAPkt2Og/r0p7PKAZVw=; b=f2+s4gA7821Dc3R0hriwW+nWyKZZY9GE6Ixr95HGC+cnjwNh64myB6XxeUTCxqice8 dlKO+ROwV5PYV2IMUKDAsjkN4Kj6gkNpaiIoKGGwRUkQ9hZw08hXgt3AyjVLf3u+zA6e E4U5RC+DmMuQEBZ9I0jFwDd6D1LFNC8yzkt7HGwsM2pgJta38GRC+R34NcVEPstZZrH4 rUhGy02dEtH2+QJzOgwxJqo9OEUv9kG5tDnkIY3JKSyWFkN4d9ZVun90/N1X+z8Lg/Is UVyTmHzwMAPLmS2nstLol8d0gzA52y3i2Jf8+UrjTE/7syuhg5eHWTDge4B6ShO5aCFV rzAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=ve07Nts2a3v0zoJpH01LCZ1zcAPkt2Og/r0p7PKAZVw=; b=DutCMzxtb+LWvi8tiHc8k5gUkakgN4OeClLNrRLmBbFrDQDKNqfjknUSAF2HSJIERX vP4sWv48iri7WONR9Y4x28FhXONiHG3bGgyN+MGfDyTjpDC0B+hjDwZvWT9iAyCCjCs/ gQR64EnTcaj/dEJPdScnFGM/rVwDonNgn4p/aM0+BLIE8mfglAR+90S428MNWz7GuBhR V7Vmr3aYuQ5YZZJHKjoyCZkjEs3cHMRAKfK6Z8tHkN7w9IbTyRv3zoq6Ng/+pIMN4Iz3 0o1lGsH3cQq1HHj5DfPgWsGeQ8bwusIfJdoQQvqNur4c/W/zRtyOF15GLqlkTzzXvypq hvrQ== X-Gm-Message-State: ACgBeo0jI/jWJgCsuKaGWVPsildAFFhmSWyPwUUwpLT7i83IG8HdDjgG 9NEGM2wsmAbP0Zp2Z/Uaibn+tjVYO5Z6weGF8VQ= X-Google-Smtp-Source: AA6agR5fSLEAFmcjM4MxXVAwJf3160yZH/M1DklRhsbyHtheOdXEwBT4bULmzdd1N5+ut6iQlqjSZp0vr0mQulb7UeE= X-Received: by 2002:a5d:5223:0:b0:21e:fc10:b818 with SMTP id i3-20020a5d5223000000b0021efc10b818mr1163940wra.676.1659071718437; Thu, 28 Jul 2022 22:15:18 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a5d:47a4:0:0:0:0:0 with HTTP; Thu, 28 Jul 2022 22:15:17 -0700 (PDT) In-Reply-To: References: Date: Fri, 29 Jul 2022 15:15:17 +1000 Message-ID: To: Guilliam Xavier Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary="0000000000006f3a1305e4eabc0f" Subject: Character range syntax ".." for character masks From: mickmackusa@gmail.com (mickmackusa) --0000000000006f3a1305e4eabc0f Content-Type: text/plain; charset="UTF-8" On Monday, July 25, 2022, Guilliam Xavier wrote: > On Sat, Jul 9, 2022 at 1:56 AM mickmackusa wrote: > >> I've discovered that several native string functions offer a character >> mask >> as a parameter. >> >> I've laid out my observations at >> https://stackoverflow.com/q/72865138/2943403 >> > > Out of curiosity, why do you say that strtr() is "not a good candidate > because character order matters" (although you give a reasonable example)? > Maybe you have some counter-example? > > Regards, > > -- > Guilliam Xavier > I prefer to keep my scope very tight when posting on Stack Overflow. My focus was purely on enabling character range syntax for native functions with character mask parameters. My understanding of character masks in PHP requires single-byte characters and no meaning to character order. When strtr() is fed two strings, they cannot be considered "character masks" because the character orders matter. If extending character range syntax to parameters which are not character masks, I might support the feature for strtr(), but ensuring that the two strings are balanced will be made more difficult with ranged syntax. strtr() will silently condone imbalanced strings. https://3v4l.org/PY15F --0000000000006f3a1305e4eabc0f--