Re: [RFC] Deprecations for PHP 8.4
| From: | Claude Pache | Date: | Mon, 08 Jul 2024 18:23:50 +0000 |
| Subject: | Re: [RFC] Deprecations for PHP 8.4 | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-124294@lists.php.net to get a copy of this message | ||
Le 6 juil. 2024 à 03:22, Mike Schinkel <mike@newclarity.net> a écrit :On Jul 5, 2024, at
1:11 PM, Claude Pache <claude.pache@gmail.com> wrote:Le 25 juin 2024 à 16:36, Gina P. Banyard
<internals@gpb.moe> a écrit :https://wiki.php.net/rfc/deprecations_php_8_4*
About strtok(): An exact replacement of
strtok() that is reasonably performant may be
constructed with a sequence of strspn(....) and strcspn(...) calls; here is an implementation using
a generator in order to keep the state: https://3v4l.org/926tCWell your modern_strtok() function is
not an _exact_ replacement as it requires using a generator and thus forces the restructure of the
code that calls strtok(). Yes, of course, I meant: it has the exact same semantics. You cannot have
the same API without keeping global state somewhere. If you use strtok() for what it was meant for,
you must restructure your code if you want to eliminate hidden global state.
—Claude