Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:128984 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 lists.php.net (Postfix) with ESMTPS id B55881A00BC for ; Mon, 27 Oct 2025 17:53:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1761587632; bh=IjYslsMzi7d+RP6MSMzZVn1JbV5lf0/pBdmjUA1r+Qs=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=Xmbg+xYWmpDUp6MS2ua06JA1w3ZXrXZeVHWdRn8TQNmAeKSSP3CzV12ZecrW4R2/D OVHEitXphapd5WuzOISSrOiZzPE0eSPX9gW79ioD4lHToFa68ggAVLnwXmF0AMsuKH cBHNf5p2Q5LHaoHcxX7QvA9MLX3TUsjdTInPgmIZKOZPA/LRzjtB3naS4qTyDG7XmR z3s8GaZ9JxW1mDwj+QodvQ03LE751HuCVPSC3bRpcZewSc186suMpd1pWI4qsKbZKV yOZF9GLshQRCrqRMACg24CaNkJkBR5XxPQ1k42BexncYH8szQ4qYKD24m/x8HYX7Vr tC274ziQTWjoA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9825118038F for ; Mon, 27 Oct 2025 17:53:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-vs1-f44.google.com (mail-vs1-f44.google.com [209.85.217.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, 27 Oct 2025 17:53:51 +0000 (UTC) Received: by mail-vs1-f44.google.com with SMTP id ada2fe7eead31-5db37a935f1so1895625137.1 for ; Mon, 27 Oct 2025 10:53:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1761587625; x=1762192425; darn=lists.php.net; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=IjYslsMzi7d+RP6MSMzZVn1JbV5lf0/pBdmjUA1r+Qs=; b=XStgbuUhnYZol8h8UqqGL9CzuyIJtknsFb6CZPLmZ5MxxaDoj5ohlrRojDIbTeNm50 cwtPzHT6v242/gUVfamlnCP8k0Bb7UwUehhwhHB1eu09nAkbzV9iOqFbG68Poa9QhM1b WClM+U05iPE6Id97Lk7atvOdWu+/BBX4at/ZRcs1vRrljmx2nKr+3ITjrqengrBGFdIo 3HTOX6a8X2lCwfpKpassvphgbkKvn12qU96Uc3LLH4yJ8bSnefWeWmL0dfIskWcZlYPO lAocmJ95Wt111svJJkwLup4se2POVeEc2dNqlGC46oeWENYWCZk/vHx2XcbqCCa9EdA+ Io6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761587625; x=1762192425; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IjYslsMzi7d+RP6MSMzZVn1JbV5lf0/pBdmjUA1r+Qs=; b=e7Oox6ClWtqMD2bppSbacI8Npy61J4J2afABkDsZKJBkLcEfxywOtiVe6SRHcMeMkl 1wzt/KABSJF3E439woo5qqxWGZlY+WiBq7hxgfKYgMu2vGNlVmKTdbPk55Ish/5Gcog5 Kw301rj/U9MC+TqkaAme6YWIM0HVea+fudV01RnYiQrKGY2I2zOZHCBvPZMcktti9wVP C/8eyiq+TnTj0nVTRc9HaXKuarrhMmNU2ouL342u+wt1jp2vwkGitdpgVijfuexUhIGs Zu1QDoj7AsXttcnj/OQA8J+5Pw4QUqctffOvSr4RpMZa1Th3hP0ktwM3YtDL45+42a1G SGyA== X-Gm-Message-State: AOJu0Yysstv86bBDM2cAka+ib/0qQBp5wWV+3YMeOli8pH+hQLkXqwy1 Ngz6E5wmZOiYcbuf/c8MQr/svQE5tjv1jxXgwuzDDwL3NQPVt/RncLpxDBcTd3m2WIxRSXy6yw8 EDTu8XNDOVhPBdup4Swz07ARpBaLbdodj4M/9 X-Gm-Gg: ASbGncvQ39r+npgp6pdex3rtx7s/3bHt2LDD5dD2M7Rsrs4sad+EsTKNfGxa+M88/XX 0wFi1pLZ9W1t8pXjnWjdVbH7YIfSmltfpokFnYdnmxbZUz+QHqKPqN39GykZX6ByvSOzsV+A5aO zPF9O+hYpqq1P+7ph3eU/X5jy1NSfr4tq5a1alIOBEoaQENy16ZbPbDk/dJ0vak5rKfpJQLkU7H O+cy/sti/tWshiSnd/rpeaKu8vcXzft1UMuOpBS5V2I0j5QWFcevxunVVcFwFCnHrXN0ijbBFtc u84m0Fhf88ecpwYN9hwEO4HI0W+11sl8omtDuQ== X-Google-Smtp-Source: AGHT+IEO5qkjd0suGjDvS108dydAZkUaej3hAsLxaIYBviStkziWqXHt0ba/dOR4XB3gmGMxPedr8iFLCwQbjwjU5MA= X-Received: by 2002:a05:6102:6a94:b0:525:df9e:9365 with SMTP id ada2fe7eead31-5db7ca8873amr380040137.16.1761587625596; Mon, 27 Oct 2025 10:53:45 -0700 (PDT) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <889d3042-7b3e-4152-bd8c-09bbcc967309@app.fastmail.com> In-Reply-To: <889d3042-7b3e-4152-bd8c-09bbcc967309@app.fastmail.com> Date: Mon, 27 Oct 2025 19:53:33 +0200 X-Gm-Features: AWmQ_bnLw2EcVlkFaO0EHU0bU0YuQPhxkanA4kLsgLVcGEEFFCLaT36XRMHWgSk Message-ID: Subject: Re: [PHP-DEV] Re: PHP True Async RFC Stage 4 To: Larry Garfield Cc: php internals Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: edmond.ht@gmail.com (Edmond Dantes) > I am not sure how feasible this is, but would there be a way to split the= "async toggle" of IO operations off to its own PR/RFC? > To me, that is by far the most important part of this RFC as that's the b= iggest blocker for wider async adoption, > but I'm not sure how many layers are needed above it to make it possible = to toggle in a safe fashion. Ah, I think I understand what you mean. Yes, from an implementation standpoint, non-blocking behavior is provided by the Scheduler API and Reactor API. These two APIs are always available anywhere =E2=80=94 in the core, extensions, and so on. However, this isn=E2=80=99t part of the RFC itself, as it belongs to implementation details. Moreover, do you remember the first version of the RFC? It had a function that explicitly started the Scheduler. So indeed, in that first version PHP could be in two states: synchronous and asynchronous. What=E2=80=99s the difference in this RFC? PHP is **always** in an asynchronous state. Even when executing index.php, you can think of it as running inside a coroutine. There=E2=80= =99s just a single coroutine, so no switching occurs (although an extension could, for example, create another coroutine =E2=80=94 which is perfectly valid). You keep writing your code exactly as before. You don=E2=80=99t need to thi= nk about PHP being =E2=80=9Casynchronous=E2=80=9D now. As long as you=E2=80=99= re writing code inside a single coroutine, you=E2=80=99re still writing synchronous code. -- Ed