Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129441 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 64CAE1A00BC for ; Mon, 24 Nov 2025 16:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1764003487; bh=1cFnbuzVnoxtAJybk5cVL6ogYXMcZwjp2ZjicJ2M2Lo=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=cSlNgwtSRJYWe9TqVgVSqg/TjMQOZGabz/bEGFhGi6k3OOH3xIYKJq0NLD2S5AgE1 Cm6TNgttnORqtyiNNC2W4+e+++XugItDhho4MA3gfvMgb12zrMgouOSPELNalF+I16 fGh8oP38qDDoxvhzRhbaAv5FnkqjbqxAW78P9W4FJGrVcflww3oE0bMrCMh4nqPvIJ On6Dp5QB8mBawKzauOSD7TZhhBXJZVE31B7XfGkNo3dB/ntcqJOLlRpb+mDhJlXRKT Jm8LwnIbjQBeAOcUShwqaI4xpC8EuxegjsShWYHvAq9XnoyLDHOlbGMbFAiT0Kvkwj ZAqNPazRHN0oQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 13854180077 for ; Mon, 24 Nov 2025 16:58:04 +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,T_SPF_TEMPERROR autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from mail-ua1-f41.google.com (mail-ua1-f41.google.com [209.85.222.41]) (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 16:58:03 +0000 (UTC) Received: by mail-ua1-f41.google.com with SMTP id a1e0cc1a2514c-93a9f6efe8bso1171381241.0 for ; Mon, 24 Nov 2025 08:57:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1764003478; x=1764608278; 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=khtUGrk5gtKZI/xRUtyRksprjywjiiNU8sY25qy/QVw=; b=iAHmUFsqplr31qjHcXKvme1KNA4/0Zd2oh1wPgWRBD70tRQ0o3LdQX57X4fX/TsFRT ndVkS2e8BbXrcPL5zb55PXxZGo1vdr7gB3TfpfKgBTPV/sy9VU8KWXkbh0a+s874Pw71 4SukwB+x0PJVr9GvumvXKJ57mnzMrpQ8uz9yeIwbWDmV3PosgRWKddaDVLJMe98MRYBm XqrHEXiGVrc0PWIovCPqhXYjnDqYjeEMuaKZh1g5iCY9a7Zm5wkAZIU6ObU636AXLkFl tSjX5R3324TCdicw+oObxW5k0ymAxZxrgIYgsOz0Nncrz1L4GD4APicOgv9lzp2LI/GR 0pJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1764003478; x=1764608278; 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=khtUGrk5gtKZI/xRUtyRksprjywjiiNU8sY25qy/QVw=; b=qh/2VMPM8mahTxavkDGrcBJ/EVysPmtTakG51VdO9FBAkBSIR3Ax2+jYlRJyhEBTbz fRY9CxsWfA4e+dIlwxt/R/jNZCMo/QMcO3r8pDxpqA49PAHlldueQyOy8tmTq/RZij/i UzmyizE89oxyy11KA90/ruOgm2ZmQaXaEL4UymSXjhlOmv3FyXxxRSRzDYnv61/3VHA/ aRXHXvPzCj4V8/lWd/vENrmOij3x3E5YjPqUBgQFj7CNuW1fJXZIIgIK/MQ/U9SdIM1l rOK4lpdkllUXD/XpHZfF4OQX/YgkG9DfOAUHUPmaZRj3pF5UcF8gAe8y2qG8bEwXbazX wNxA== X-Gm-Message-State: AOJu0YwPg0QAR9AvjAkCPPg4K6xUxBu5jf+h3BN+pss1OgNoy7NrAIrV IxUuudHisDd18r6QacWs6fdRrT6nrgcIp/aiH50RF4xJmEBQTONaO9OkU/EYgA5sw1hMCgngqa2 7I9gdVgweOWZlzZvPmhRe7VvFlE/fUkpoMNE1zJ0= X-Gm-Gg: ASbGncvLo52KnSZBIaCYfkVUdrcJPc2yVrq3At7QqjmvWGMpTYdltYLp4mVlTXuOTX0 elgjkFxauYBwZaMzJuY7mMk/NX8fNHJbK/75R1gQdLGMhxLcKkYNRyZxTG6FH2k8UEV5TVn6Qs/ p60z23Qc7iIw9NJwcuE0jsNuYfHBiMX2P2Xwfx0RGmF1IsmOSRCRJrWDVOqw1bF8in9pgm88N9C NfXthBllzoTofYHwWYroAmkNOJX2Y0CwMXa/BXhzvheGhmiENhIlwEyKOt+05XbZC00tWlKYn8C 7NkD9w7wdDdY+2fp+ZAWD8iGBy8= X-Google-Smtp-Source: AGHT+IFka9VrGRaQLMthd1R/bA1f961RR0rMeVhFNcro5O2rl4O4voH7zGXLc05BnIUGecPtAAyDnTTQyC18FUzcg0c= X-Received: by 2002:a05:6102:5983:b0:5e1:839b:4540 with SMTP id ada2fe7eead31-5e1de40c294mr3296432137.44.1764003477941; Mon, 24 Nov 2025 08:57:57 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <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> <65869feb-d518-4de3-8c10-115e3ba7dce7@rwec.co.uk> <55149f3e-7ec7-4479-bd6d-2e7fe1b8edef@rwec.co.uk> In-Reply-To: <55149f3e-7ec7-4479-bd6d-2e7fe1b8edef@rwec.co.uk> Date: Mon, 24 Nov 2025 18:57:46 +0200 X-Gm-Features: AWmQ_bm6yPQvgSiMne15eZZ4iVyH8pUM0L_JUDbINSOYOqwRWhyrJhAv1OuWHdI Message-ID: Subject: Re: [PHP-DEV] [VOTE] True Async RFC 1.6 To: "Rowan Tommins [IMSoP]" Cc: internals@lists.php.net Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable From: edmond.ht@gmail.com (Edmond Dantes) > An error will occur for whom? SDK Susie when unit testing her library? If SDK Susie used a new coroutine in which she calls the `LoggerInterface::flush()` method, then with some probability the user may notice that log entries are sometimes duplicated because the `LoggerInterface::logs` property is not being cleared. You could say that SDK Susie is responsible for this, because she ran code that was never intended to be executed in a concurrent environment. > If it is an error for SDK Susie, what is her solution to allow users to p= ass in a logger to her library? To avoid the error, SDK Susie must be sure that the **LoggerInterface** implementation supports concurrent execution. If SDK Susie knows that LoggerInterface does not support asynchronous code, then she should not attempt to call its methods in a separate coroutine and should use LoggerInterface in the usual synchronous way. The shared-nothing memory model doesn=E2=80=99t even give SDK Susie a chanc= e to make this mistake, because it simply forbids the existence of an object with two references. > If it is an error for Legacy Les, how does he fix it? In this case, we should assume that the responsibility for correctness lies with the one who provides the new functionality. Therefore, Legacy Les should not have to do anything. However, if Legacy Les wants to use the library, he needs to do the followi= ng: ```php function flush(): void { $data =3D $this->logs; $this->logs =3D []; // It is guaranteed to execute without interruptio= ns. file_put_contents(implode("\n", $data), FILE_APPEND); } ``` I want to point out right away that the code above is not suitable for multithreaded execution.