Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129296 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 1D3F41A00BC for ; Wed, 19 Nov 2025 09:54:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1763546077; bh=Z5JLA5iP7lk+SYCJBpw4Pmmtq1qP9CjfAQenRaWZTVc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=lbWG3LXSXqvAE4lVGxHtS6uwdnj+uN3tIj/y5HZ7rb6qjeMATbmHpmea8s1wtCwJv FaSQj5+nS1j6TJO7pam2xWIVwr5ctjMbMOOB98kz4wuNAlWN1v2Mb2an4vjXncc6n2 9qQSs6xKdEltZzJOLcIXNjkPFUFePn7i3MceXQgf8e+BbxAc9DST97IeJLume5tnO7 O+DLxTt0YbiC1Ob3WureGf4cI6Op7xoRANdDczK4Cw+z5zjJHdZi4YFVe+I0ByaRnQ BXlpvWsFBPD9/+jCcZ/6XgfgqwQtwABc6uWHdWPyyzvgQZq2mV5TBlsdjUPXGIfTvJ 57whDhCm0Yn6g== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id B3DC1180381 for ; Wed, 19 Nov 2025 09:54:33 +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, HTML_MESSAGE,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-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177]) (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 ; Wed, 19 Nov 2025 09:54:33 +0000 (UTC) Received: by mail-lj1-f177.google.com with SMTP id 38308e7fff4ca-37a5ab1e81fso54933871fa.1 for ; Wed, 19 Nov 2025 01:54:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1763546067; x=1764150867; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Z5JLA5iP7lk+SYCJBpw4Pmmtq1qP9CjfAQenRaWZTVc=; b=KHbcMBqcNVceUin0W7FYSJVL5W6pujEw/mAonsJe8i8RYmmcic4hhqewGNYFRZCnfZ wQVy3VO1DC0gw6l0cT887ihAhpQS53f1DJDCwmsrFVrNvXGQYicP6VTsNA8K5JZy0Cng REKPZpf/VQKTEmlRS5yFtVZWH8ESRHgg8hKW8Rh8No+JHR9isPPp/77y1cBTBZXA6QaR Yo36tppghIUsGwFeWE+KX3jwJolEJz5uP3qSuOn6/MHA2AuRwovVFy97DsfTzaNC5VBG prW3ACEiBF4DM+/LLefivxJJIhNWnoTLsFsKajxSQGQ+0M58mWHGQ5n9t9sCYYMWo+dN rT4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1763546067; x=1764150867; h=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=Z5JLA5iP7lk+SYCJBpw4Pmmtq1qP9CjfAQenRaWZTVc=; b=gj4fNkXiAYnP456WAN10HhgB6nIc4PTza5XO8+wYvf7sERGZLMwEY8ZikG+g6QI6Mp YQXs5c+jJjR2F+jqmpc7ntK7oUt+ARx+H7l7nptF0pzHql96W9GarZcZpKP2KH+YDffG KBJO2exUuFQHbVTV7S64gq93N18gflzLFB1p17eVaXfbk7KZGUdgWLNrYp3bBt3O2fPV Kc5DtG3VynAug6u0IFcPslYYFcEBPRaZb0rPAysDQL/xRqkGvkzIqQJ42UtCINovFsjB 0wq3G4bOWhcZtntnkYJz+q64Lsny+ifgA5PYu/VisMqBvwwpcMF15cmR6zmPgTVpInNM SvSg== X-Gm-Message-State: AOJu0YyuWg2W2HnuGaQTvLrtMpZ6QohmbIJNYHyOXeLGNdhCrCBUa+6u i2faMap9LQeAyrZHLH4hJ5GmTMZ064X03IQtokZuBTgdfcScCnBxyLNtNAeCAThXGU8e/vAHPv+ 1U8z7qF9+qHZCIVpjnV1mEGUBWlvSXVo= X-Gm-Gg: ASbGncttAyxx6+9NSz0AceN2a8OkpON3LKZffa3uTx5tLMvQOcQAXz1dTjJaPCqxh9j d4GuoePA9uLROOt/Ji6YTjVZcfGAJxGJndokXS1Q2oMwWXIbER20w+byb2v7ige+WNLFumCyMcH GCcfNAHwRZvL7Ei5e0htD6rqoaOXK2o3NckQjyQ7QsxUPj6U2Urp77AMe0XWC60ZCmVDSaWZYod 02e9PDHZFRexf1udTqrPNfMtnhdr4rF9oIzW4F3cQQPItD9ZCkvS8FpM08ROZ9dS5gxUWCFBcXp L8y0aMGfLoRIqwRetnvn+88G X-Google-Smtp-Source: AGHT+IF7x4fpiRTx6U6JXvLSTSqCFxjO/xJyfvxVTVNtnWtgVGTdFOxnk3LyYDcciY7bYe7FhriufRxD0NseT7aLBy0= X-Received: by 2002:a05:651c:41c6:b0:37a:7d5e:db9e with SMTP id 38308e7fff4ca-37babb6b29amr51962991fa.8.1763546066716; Wed, 19 Nov 2025 01:54:26 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: In-Reply-To: Date: Wed, 19 Nov 2025 10:54:00 +0100 X-Gm-Features: AWmQ_blMxZvgzkyUWYIqEJcsRA8lCuy54hRqhvR190Ts3CbyW18f_k9vpDDQo9Y Message-ID: Subject: Re: [PHP-DEV] [RFC] Stream Error Handling Improvements To: ignace nyamagana butera Cc: PHP Internals List Content-Type: multipart/alternative; boundary="000000000000da0b620643ef9005" From: kjarli@gmail.com (Lynn) --000000000000da0b620643ef9005 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Nov 19, 2025 at 10:48=E2=80=AFAM ignace nyamagana butera < nyamsprod@gmail.com> wrote: > > On Wed, Nov 19, 2025 at 10:45=E2=80=AFAM Lynn wrote: > >> >> >> On Tue, Nov 18, 2025 at 7:40=E2=80=AFPM Jakub Zelenka wr= ote: >> >>> Hello, >>> >>> I would like to introduce a new stream error handling RFC that is part >>> of my stream evolution work (PHP Foundation project funded by Sovereign >>> Tech Fund) : >>> >>> https://wiki.php.net/rfc/stream_errors >>> >>> Kind regards, >>> >>> Jakub >>> >>> >> The naming of "terminal" is a little confusing to me. Reading the name >> with a bool made me think it was whether or not the CLI was being used, >> which made little sense in the context of stream errors. After reading t= he >> explanation "Terminal errors are those that prevent an operation from >> completing (e.g., file not found, permission denied). Non-terminal error= s >> are warnings or notices that don't stop execution (e.g., buffer >> truncation).", I feel like it might be more clear if this property was >> named after what the result is, perhaps something like "operationBlocked= " >> or "operationPrevented". >> > > > I believe these types of issues can be resolved by replacing boolean > values by Enums, hence my suggestion. Enum would be more self explanatory > and would provide better insight on the outcome. I also like Jordi's > suggestion, anything that can help static analysis is the way to go IMHO. > > Best regards, > Ignace > I ended up removing this from my first reply, but an enum was also what I thought of as it wouldn't surprise me if a 3rd state could be introduced: fully prevented, fully executed but with warnings, and partially executed like a buffer truncation. I just don't know enough about the underlying errors/warnings to suggest this as alternative implementation. --000000000000da0b620643ef9005 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Wed, Nov 19,= 2025 at 10:48=E2=80=AFAM ignace nyamagana butera <nyamsprod@gmail.com> wrote:

On Wed, Nov 19, 2025 at 10:= 45=E2=80=AFAM Lynn <kjarli@gmail.com> wrote:


On Tue, Nov 18, 202= 5 at 7:40=E2=80=AFPM Jakub Zelenka <bukka@php.net> wrote:
Hello,

I would like to = introduce a new stream error handling RFC that is part of my stream evoluti= on work (PHP Foundation project funded by Sovereign Tech Fund) :

https://w= iki.php.net/rfc/stream_errors

Kind regards,

Jakub

The naming of "terminal&= quot; is a little confusing to me. Reading the name with a bool made me thi= nk it was whether or not the CLI was being used, which made little sense in= the context of stream errors. After reading the explanation "Terminal= errors are those that prevent an operation from completing (e.g., file not= found, permission denied). Non-terminal errors are warnings or notices tha= t don't stop execution (e.g., buffer truncation).", I feel like it= might be more clear if this property was named after what the result is, p= erhaps something like "operationBlocked" or "operationPreven= ted".


I believe these types of issues can be resolved by replacing b= oolean values by Enums, hence my suggestion. Enum would be more self explan= atory and would provide better insight on the outcome. I also like Jordi= 9;s suggestion,=C2=A0anything that can help static analysis is the way=C2= =A0to go IMHO.

Best regards,
Ignace=C2= =A0

I ended up removing t= his from my first reply, but an enum was also what I thought of as it would= n't surprise me if a 3rd state could be introduced: fully prevented, fu= lly executed but with warnings, and partially executed like a buffer trunca= tion. I just don't know enough about the underlying errors/warnings to = suggest this as alternative implementation.
--000000000000da0b620643ef9005--