Hi

On 6/27/24 19:09, Chuck Adams wrote:
Personally I say let strtok be and just admit in the documentation that it’s 
weird because C.

strtok() is not weird because C. It does not rely on the libc strtok() function and did not since at least 1999 (and likely never did): https://github.com/php/php-src/commit/257de2baded9330ff392f33fd5a7cc0ba271e18d#diff-fcf8a2a38ee4a0e3e2cb7c47251c9920ba8c5886d85969f676f9ddbee7aba503R332

strtok() is weird, because someone believed that relying on global state was good API design. I find that excusable, because it happened more than a quarter of a century ago.

Best regards
Tim Düsterhus

Reply via email to