Re: [RFC] Deprecations for PHP 8.4

From: 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 [email protected] to get a copy of this message
Le 6 juil. 2024 à 03:22, Mike Schinkel <[email protected]> a écrit :On Jul 5, 2024, at
1:11 PM, Claude Pache <[email protected]> wrote:Le 25 juin 2024 à 16:36, Gina P. Banyard
<[email protected]> 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 


Thread (68 messages)

« previous php.internals (#124294) next »