Re: [RFC] Pattern Matching
| From: | Larry Garfield | Date: | Tue, 02 Dec 2025 20:40:00 +0000 |
| Subject: | Re: [RFC] Pattern Matching | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-129516@lists.php.net to get a copy of this message | ||
On Mon, Dec 1, 2025, at 7:24 PM, Stephen Reay wrote:
> Hi Larry,
>
> Is there a specific reason why less than/etc comparison (and the future
> scope of ranges) is limited to numerics?
>
> 'A' < 'K' comparisons are already in the language, and range() accepts
> string arguments to produce an array of bytes.
>
> Cheers
>
> Stephen
Because neither of us ever use comparisons on strings, as it's not super reliable, so it never
came up. :-) We'd prefer to keep it numeric, as the logic otherwise could get confusing.
(Personally I'd prefer to even exclude numeric strings, but that ends up being more work.)
--Larry Garfield