Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124294 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id AF1111A009C for ; Mon, 8 Jul 2024 18:24:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1720463129; bh=WMQmdmlgYcdw8F+P5pixkgdEWEpEDZNE/c0HMD4wARg=; h=Subject:From:In-Reply-To:Cc:Date:References:To:From; b=jBeXStfuyzoesWkoQd7bin5uhWZ2QBx+VI4BVg7btSURdy8QY6KBcMn5u4r+2yS8K LlZ3bxFP6xU2Qa49wNoCbOpsI8P5Z/lhn2A6OGL2IL19Rnswy1bqjCfrdX48p086bw /S8bP65sNw6O6qUp4KD1hp7eV9VbOqX1m8K1cKsj4bZcBUwhK3vwHbg7yZ7qYCwpBg pSLV+BMQ8s5yzBhZHkqtcpDCCPalr16Uwg4F14AgJfLPcBuVRQ2P+6nKYcagBBYwWo aXDof5yg43tj+U6XU3ezOySqYwn9kwXBEqFsVINR1MnxdOzYo4YFODx22riQpEwZqD /opJKysOPcC2w== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id AAA3D1806A8 for ; Mon, 8 Jul 2024 18:25:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,MIME_HTML_ONLY,MIME_HTML_ONLY_MULTI,MIME_QP_LONG_LINE, MPART_ALT_DIFF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from mail-ej1-f44.google.com (mail-ej1-f44.google.com [209.85.218.44]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 8 Jul 2024 18:25:28 +0000 (UTC) Received: by mail-ej1-f44.google.com with SMTP id a640c23a62f3a-a689ad8d1f6so472588766b.2 for ; Mon, 08 Jul 2024 11:24:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720463042; x=1721067842; darn=lists.php.net; h=to:references:message-id:date:cc:in-reply-to:from:subject :mime-version:content-transfer-encoding:from:to:cc:subject:date :message-id:reply-to; bh=WbUPz42x+gjWNZ3dXHP8VlGdYroWnIBvPKuqnnMu4fc=; b=Lf3aBV2Fvt/PlxKLLs4rHAtHk+FXXaHkDf1YSS7fmvwlHBNrkojblWFpHgHVPIV9sY t72sw7gOqd17Gud6yjwkaONuh9fnMQ5zrkMfBnZlCF8DXa2Re8v75IgqZvK5rO5P7B4O /mCJTfFf+gcsOFkN6vuyt2BdEHUkFDoXF5WR36oWpZYPQ2+6r2Mz9sAdeZo7p/mLw6UB sBmfz+XCgUMF+d1IaLEmX9TARX04sb50JCywfSpI5UJAwmUnevBDVcbdV8qto7Wh8BVz 1NjmdAIF1O3W4E7Hl1rUVT7AK0vugdXZwr1paRg8r9IVCzwvr64Dlnp/0lYJ3wTwpVD/ pkWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720463042; x=1721067842; h=to:references:message-id:date:cc:in-reply-to:from:subject :mime-version:content-transfer-encoding:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=WbUPz42x+gjWNZ3dXHP8VlGdYroWnIBvPKuqnnMu4fc=; b=LhyVK9vBJOkFLXrj/pXUMZ8cJ/hsZsxTN8zTe/XWGLe/2ysXxp8XrJA96KmbSOX/HT TZIykUX/aoLc2mK1s7okQRCkEMfnbfzKNS35w94ePjjoEaM01Bj50VpnzrftYFTRVQTv QuGwWm5PtwD2+m8+JjNfQq8DZJ1pqwE1NC4u2VbSgsdWertfH8Wxm1Iod9m1DizNWROX VtWFkhaW9KnVXNDqERPQQD+nUGsYNs0UM8vUZqYPmO2ZTUq0bJ6F3JW61D9sSrYj+FA7 4KoQPvF33XnPdgo0Xy4xNKIhsoLdHgG/JFlISZQ3II7Go+l99Xn9z4H3hT7gu0byWeFQ V8PA== X-Forwarded-Encrypted: i=1; AJvYcCWTE69xZzdTwI0oyY+AoMxMEb5Ny9IfYG3NlAPmjA1RC8f3LCt0rdbTWfGTF20RnJU34E7C9SBLGe7+/t+ifdmYXaXFuo5j6A== X-Gm-Message-State: AOJu0YwZD1VuynVdKv7vxf72PWwOx/NCevUVZXGIuP+a5LnbLPpMz5Oe AtWIKQfe/6ryZc7NXIqvxud59Eo7feHTOn8jbMnC7uOAya10A//D54YLfw== X-Google-Smtp-Source: AGHT+IGcXdW1p1ZNPhhLPHzeupcVDnagXLgKErNA+yDLXhIrNaNVfTUwVJ0wP1ZZCaP9FNqBqsZP/A== X-Received: by 2002:a17:906:6857:b0:a75:21d3:60a1 with SMTP id a640c23a62f3a-a780b89ab19mr23666966b.75.1720463041732; Mon, 08 Jul 2024 11:24:01 -0700 (PDT) Received: from smtpclient.apple ([178.197.194.133]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a780a854a27sm13935066b.162.2024.07.08.11.24.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 08 Jul 2024 11:24:01 -0700 (PDT) Content-Type: multipart/alternative; boundary=Apple-Mail-E9E745C4-AF11-4394-ADF4-0C7848EE946C Content-Transfer-Encoding: 7bit Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (1.0) Subject: Re: [PHP-DEV] [RFC] Deprecations for PHP 8.4 In-Reply-To: Cc: "Gina P. Banyard" , PHP internals Date: Mon, 8 Jul 2024 20:23:50 +0200 Message-ID: <80F9B4D6-EA03-42A0-BB6F-7BA06D2B1089@gmail.com> References: To: Mike Schinkel X-Mailer: iPhone Mail (21F90) From: claude.pache@gmail.com (Claude Pache) --Apple-Mail-E9E745C4-AF11-4394-ADF4-0C7848EE946C Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable


Le 6 jui= l. 2024 =C3=A0 03:22, Mike Schinkel <mike@newclarity.net> a =C3=A9crit=  :

On Jul 5, 2024, at 1:1= 1 PM, Claude Pache <= claude.pache@gmail.com> wrote:
Le 25 juin 2024 =C3=A0 16:36, Gina P. Banyard <internals@gpb.moe> a =C3=A9crit :

* About strtok(): An exact replacement of `strtok()` t= hat is reasonably performant may be constructed with a sequence of strspn(..= .) and strcspn(...) calls; here is an implementation using a generator in or= der to keep the state: ht= tps://3v4l.org/926tC

<= /div>
Well your modern_strtok() function is not an _exact_ replacem= ent as it requires using a generator and thus forces the restructure of the c= ode that calls strtok(). 

Yes, of cour= se, I meant: it has the exact same semantics. You cannot have the same API w= ithout keeping global state somewhere. If you use strtok() for what it was m= eant for, you must restructure your code if you want to eliminate hidden glo= bal state.

=E2=80=94Claude 
= = --Apple-Mail-E9E745C4-AF11-4394-ADF4-0C7848EE946C--