Re: [RFC] Deprecations for PHP 8.4
| From: | Dusk | Date: | Wed, 26 Jun 2024 05:39:08 +0000 |
| Subject: | Re: [RFC] Deprecations for PHP 8.4 | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-123855@lists.php.net to get a copy of this message | ||
On Jun 25, 2024, at 22:18, Mike Schinkel <mike@newclarity.net> wrote:
> This leads me to think
strtok() should not be deprecated given
> how inefficient string handling in PHP can otherwise be, at least not without a much more efficient
> object for string parsing.
What would be really useful as a replacement for strtok() - among other things - would be a function
analogous to MySQL's SUBSTRING_INDEX():
https://dev.mysql.com/doc/refman/8.4/en/string-functions.html#function_substring-index
Where SUBSTRING_INDEX($a, $b, $c) is functionally equivalent to explode($a, $b)[$c], but with the
added ability to use negative indices to count from the end of the input.