Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129382 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 CDD021A00BC for ; Sat, 22 Nov 2025 04:18:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763785095; bh=ja1l1N6TeyfNEhKHSCmsMoRBcteQDm/p5PdCatkANCw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=YGF1U3PhEXf2hx8qIo0ciai75WI1ZVnoev7eU6s/AL2mO8SVw48FyLuGLGfVUoI0o wm+td9ermwZd7p4P1oHWaMje1RkIJfW7S3X38qNPIWh/hTm3wet1khbFo16MVmvzNU 4GkKHspHWQFEKYqHxdH2TcAm+LPU1wYSRh2HpN5r/mM8+ziPC/XBAh1MgdyP++1aYM QCsoz5N1bzd+SczNhTjkgMUpVDmVfNIcMFexwc2WOVgICNDx9ffrl9qRCjJPSzZP6b eRJlZyxzRnEDhah3acvynrHYu1zllc9hfUfkYH4Yb/gSPhTT3fXzZPsHqhL3zQrf6u BbLyGN6dwwKMg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id CD37918003F for ; Sat, 22 Nov 2025 04:18:14 +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-ua1-f43.google.com (mail-ua1-f43.google.com [209.85.222.43]) (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 ; Sat, 22 Nov 2025 04:18:14 +0000 (UTC) Received: by mail-ua1-f43.google.com with SMTP id a1e0cc1a2514c-93723104137so803108241.3 for ; Fri, 21 Nov 2025 20:18:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763785089; x=1764389889; 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=ja1l1N6TeyfNEhKHSCmsMoRBcteQDm/p5PdCatkANCw=; b=f06A18ZDLz8xizOoRwRPSx+7LLx4FlNQDhZrEBAhL23dO96tW2H5gYNInWKeUmkbNn ukVkozLsbWDYmFORAcOeve13pHX4wC43386fvQ6duIQiz98JjGbUg2g0w7GKUm1YCIkX 9ro8NQxegrYCSi9s10wFmRilPYANIWJbQehFSBr8XcYdWRjRWtEk00mqC8ccfDZwVyjI ja7gVtgvnlZk1vuuPkvjuOrrGBKd55lcbcDL5sZA2sq1D2w4eX1R9+0A+cyRnAo7dOAn IhAOo/bj6/Okdz5SdrroiMHgcGunuI/0pRxMTYSXK47GJNYMqZF8aTL/HzngKp1sGqkv FcVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763785089; x=1764389889; h=content-transfer-encoding:cc:to: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=ja1l1N6TeyfNEhKHSCmsMoRBcteQDm/p5PdCatkANCw=; b=QRESPCiRzlp9wlV9VlaplqUH3QZQdjjblTva/31lMN3WK/vbjH6aAraqev3JbncHyi iz+q239GjlXaAhuN8kk4QKGZo3do4uJMpICupgs/flztFKRyFHbxRsfWYCKh2U4oDMxn /mbLiSskx9vP3O85RIKtLjV6dIXqEURiLu1AYK+l3Kk/A8ypENvMf+Od2+PRd/1qV/8h CZI7ozt1VTzCJb/FZOY/aM7GB0TJZx9z31kgCrlV36GK1SJ3mCJh9uI7HEbkGcPC7NAq P+l0VHPXV1s+HRFxZSkdSaQSe01WCK8Ibue9+LRa0SyTMjWOox1utZlSTWWW47Yb3yjk k0cQ== X-Gm-Message-State: AOJu0YwTmyHIVIAb5PBFkwNwirQ37zgkGxAGuxiK+29jA2U/HgabJQpp 57h66hDw3S4+opahdQWyt9r4/Cw22t9yo1v5yF9Kikqc5R32QKHnddUPh/MdHiVk35/yD6Fht4c dXeyHAsVt1C/yNaIdLp5mk2rH17/YRElwyk5DPXc= X-Gm-Gg: ASbGnct8eUrBA+umvl8NZnZE1B5YA6uPmPGgHHOd82fWbHNzuot14J1vNssI8V6W158 1PzmnguwpLD3GIJ1ccCQas5I78zpt6hn6HceWm6/nlI1ecbpLwahlsiZwR8pFtI19xydbbaxQyL s9RSP3NPkLb7h3p4LIMJiTsx15xAFvjoqgICRzvDTCLtJdPxZXSanRa5NxgpKD8T+Gh7wIE+JwD VGxF+EA3J9XUPEz1/QvXrbxM3u2/aTwHbaOyWB1NDpnowSIuGtvUsdhrqwkeeq82ZVA3T6I02ne QheEQA50aI9Z0mvoQQru2BWE3EcE+iqTHxRN X-Google-Smtp-Source: AGHT+IEFn2uDgCit5fKCg4qrOnmon0VmYPiKJOb8PFq1dlb/TROxLd9Yj8JBDsgUYcM3GrHL67sv+EylH2rDP3RkEwg= X-Received: by 2002:a05:6102:a47:b0:5de:6dc:22be with SMTP id ada2fe7eead31-5e1de43795fmr1521296137.36.1763785088849; Fri, 21 Nov 2025 20:18:08 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <383528143.397454.1763760932585@email.ionos.de> In-Reply-To: <383528143.397454.1763760932585@email.ionos.de> Date: Sat, 22 Nov 2025 06:17:56 +0200 X-Gm-Features: AWmQ_blOCNXEvQM8hrdENqob60FlOTeA-_YpMXW7GHVq_voZBWMTTMGf1PxcJfU Message-ID: Subject: Re: [PHP-DEV] [VOTE] True Async RFC 1.6 To: Thomas Bley 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 > from userland perspective I would prefer explicit declaration on each usa= ge of async over declare(), hooks and INI. This would make reviews, static = code analysis, etc. easier. > RFCs can be written in small parts for each new function, e.g. This solution has the following consequences. We have a REST API project that is 10 years old. Recently we learned that PHP 9 has been released, and we can improve performance. To do this, we need to: 1. Migrate to another web server. 2. Wrap the request-handling code in a coroutine. However, it turns out this doesn=E2=80=99t work. If the code inside the coroutine doesn=E2=80=99t yield control, then there is no improvement at al= l. And we=E2=80=99re like=E2=80=A6 this technology is useless. And then one of the developers says: =E2=80=9CGuys, we just need to rename = all functions to _async and it will work.=E2=80=9D (And he=E2=80=99s this young optimistic perfectionist programmer who says: *=E2=80=9CThen the code will be beautiful, amazing, and blaaaaaazing!=E2=80= =9D*) Everyone happily writes a script to rename 30-50,000 lines of a many-years-old project. New bugs appear. But we fix them, hoping for a better future. And then it turns out that after renaming the functions nothing works, because shared memory has to be removed. In other words, the team spent time on refactoring, and in the end they still had to do the refactoring that was unavoidable. What benefits did the developers gain? 1. Did the code become clearer? Yes, the code became a bit clearer. It=E2=80=99s visible that the functions will yield control. 2. Did the number of bugs decrease? 3. Did the amount of code changes become smaller? 4. Did API segmentation appear? People won=E2=80=99t rewrite code unless the business is at risk. And even then, very often no one does anything. Therefore, the **more** complicated the transition to asynchrony is, the **less likely** it is to ever happen. There is a chance that asynchrony could give the language a push toward greater memory safety and make it more functional in style. Because features in programming evolve according to the law of accessibility. The more accessible a feature is, the more likely it is to be used, and the more widespread it becomes. Go made parallel programming more common because it made it simpler. --- Ed