Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129424 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 4DB051A00BC for ; Mon, 24 Nov 2025 08:36:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763973417; bh=UEZFAaIF5nAGBWTxmKfLToGwIYEWCq5yNN4OUdpPlYE=; h=References:In-Reply-To:From:Date:Subject:Cc:From; b=glX+uemjB5dN3UlW9yuP9MuKjDEkuGQX+FVmrgPSeWVwi06St0BWS/T0vIZpiUiWM OuhW+nExjgyt0/hqQa0nVM3Bk7iX5gy2GlwB0QWqhoBX7c/nDCF9/HNZFbXMEWbeta dlXaSR9iDLZ9YhocN/oHjY8CSAlPImz3gIYoLQrqsQFRZdmRzC4Xhvrf3IaBLeTJ0N 2cWaLMcr+6r/4m2oxFkgzo/T91AFS84rQ+EVo2rWhzsHxi7F8ZP89Y1SdpqgJsDyUy az/yViU3nlUFQ14ud0znqWlUA7mYfnHT9XnV3NBBzrmqmOiHKS9MSI4dzJwhwwinLE YlD8AJqSsb6Rg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id E974018002E for ; Mon, 24 Nov 2025 08:36:53 +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=4.9 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, MALFORMED_FREEMAIL,MISSING_HEADERS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,T_SPF_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-ua1-f48.google.com (mail-ua1-f48.google.com [209.85.222.48]) (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, 24 Nov 2025 08:36:53 +0000 (UTC) Received: by mail-ua1-f48.google.com with SMTP id a1e0cc1a2514c-9371f6f2813so1043920241.0 for ; Mon, 24 Nov 2025 00:36:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763973408; x=1764578208; darn=lists.php.net; h=content-transfer-encoding:cc:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=eJkFkRLEHy2G6PZbrFn240JZV75gFtPpzhqBNrbinlg=; b=ZivC29Zejsy8z6DKbWf3adCd/Beb691b6AmxiiT1wHivyW+zSY7mZMiyV8It3fzaX9 LkUDNyjMNw4lAxX2t4mH3GM+YAhzIDo8y34DGvWF5SnvtJrCZEN9y5fzEBsHdlFr+x5/ zlLF5Pezzy7Z9i8ZPRsb3fP3UjLA9evefOOfnsMzrhptHJpE5qbtqgIu0TM36KwRctyG oWQ3V+4C0ooTqamwrPtmHfExhonhBt6Euo1cm+iyL11PvZgJVij9CxX0LhbfB4bD8OK4 Le2Cs85JjfS9QlYyBnML423KtD2ReI3MNRsw/a9R1rpgf52wz7etJSZtbJRXlZQRihNj uuGg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763973408; x=1764578208; h=content-transfer-encoding:cc:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=eJkFkRLEHy2G6PZbrFn240JZV75gFtPpzhqBNrbinlg=; b=O+VSWYWs33xwcvd/Co2GWi/naF0rDReEkiu8fmlTxj20P9fUdEjSrvbBatRsJAJtBE wcAVkXBmBV0skRP1xHivETHAgJM5X4i+65gCK/ieL/2/gyhGrXvpMlIRw9XLHwIT4xZa hDQtxhh/AI4SScXEssyXLtoFmDVVWv45+C92B8HPQ6ifOpPWorpq2oznkm813oLx7kw3 tSWNr2bfz9vZQWIp8ywWBkvVoOx1nQY577fxmfyxvBmgWhtiC9icIs0AhpvU76D+82Ph LtR0z+UWHfrV31oC+6CBO94g6u4mfcyc/38J46SspUPYoX7QzqKOjEjQ0YhInVWjbf54 nE5Q== X-Gm-Message-State: AOJu0YzCM0VK1ctXETNUkiYEglNsmX6g3B+T4I6tc4KMu4D1A22x8chg Sxk4DLyXqeOlrJ9xESOVkG4RVe1HhOBqDsHCgbMtl70c17cUuSWt17TbJZsGJlmL8kOiay9yN6S acwOKc2TmTJg953wp9RpMjqmq2i6rr7nlpebL X-Gm-Gg: ASbGncu9I4CivZDzElUUJ+7ZlmoUi8BCDpLZvQJTthO+DnVY1vRf9i5xv7/jqnltRZ3 7ZwzKrm0BU4G8Sh/0VE7FT5WJZ/d0VoyTCDXyGq9lOvZyNnCODKUJvZ1LDtLkVlEjK7E/ZGwaK6 Y2iy9+7R7M8JEIUDQFR34jFg5L1eBWKlMEQ3nGmsyMMOqu6q20RR7lD+I63se1tYfhM295GkgzO myHzpEaI2upWeQOoukvdqhw/8M0kZFSnep8i4t2EIEEU0DBUdFSSRTdrS2J9ESMct+FHW5i29R+ oVfsh0fh5/FjDfT550AjJnUX8e8= X-Google-Smtp-Source: AGHT+IEv5Zr8wskZuCDgrOnoiNl3tBpI4ImIZk70XICo1hUfP6P42bDYUaOTF0n5L8zDgLrYmRuMVWwfJU4fd1vV1no= X-Received: by 2002:a05:6102:50a1:b0:5d7:bd67:eaf with SMTP id ada2fe7eead31-5e1de1f88c7mr2894871137.18.1763973407680; Mon, 24 Nov 2025 00:36:47 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <691963327.399484.1763796022993@email.ionos.de> <1402906904.784903.1763811759896@email.ionos.de> <2015208655.784984.1763811978476@email.ionos.de> <980296152.1071.1763813573083@email.ionos.de> <92865666.4510.1763818506332@email.ionos.de> <329450798.8037.1763822426377@email.ionos.de> <9287c46c-bc63-4dd0-9792-0f9421959589@rwec.co.uk> In-Reply-To: <9287c46c-bc63-4dd0-9792-0f9421959589@rwec.co.uk> Date: Mon, 24 Nov 2025 10:36:36 +0200 X-Gm-Features: AWmQ_blKKHjFkv1GuMg2t3hyDi4RNLblgdzAnOm_KnW55GwgaP3GcO0EZ3bppfg Message-ID: Subject: Re: [PHP-DEV] [VOTE] True Async RFC 1.6 Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: edmond.ht@gmail.com (Edmond Dantes) Hello. > I think there's a lot of confusion in this thread because different peopl= e are talking about different scenarios. Perhaps it would be useful to intr= oduce some User Stories Yesterday I briefly reviewed the WordPress code to estimate the refactoring effort. The amount of global state accessed through `global` and `static` is quite large. However, it seems technically possible to switch global and static variables per coroutine. I=E2=80=99m not sure how this will affect performance (maybe 1=E2=80=932% o= n switches?), but the task looks realistic. At first I thought this was a bad approach, because if such a feature were added to PHP, everyone would start using `global` as a way to exchange data inside a coroutine. However, this situation can be viewed from a completely different perspective: ```php function myFunction(): void { global $x; } // This code is equivalent to: function myFunction(): void { effect ?string $x =3D null; // <-- function effect, external dependency } // This code is equivalent to: function myFunction(): void in ?string $x { } // Then calling the function: with ($x =3D "string") { myFunction(); } ``` In other words, this is a function effect that turns previously unmanaged and unsafe code into a function with an explicit external-dependency contract. And in the future, it could be improved by adding proper effect support to the language. It turns out that a feature previously seen as an antipattern can actually be framed as a modern concept from functional programming. Of course, these statements need to be validated with code and testing, and they also require a separate RFC.