Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:129718 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 96CC21A00BC for ; Mon, 29 Dec 2025 18:52:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1767034382; bh=vO+hsWKgOP2ctORhjV+4WOMADA2n6GXReej0YoPgbjc=; h=References:In-Reply-To:From:Date:Subject:To:From; b=jk3UMpSzzhucHvtH0aZ26MuSSObxa+mHFnE+vFgGOCRmvY54tp9hWReuDVLLT85KG DKiaBPpRGzxycbOIcTCBERnHbejxWTYE4vrZxjDajx/yGLBVJrOYSljNtBwrnnT3SA CKrVyBsNhxRifEsRKQb/wQ3x/q/Lr1IYAa5UeHJS+to2npXQ2rFG+PJSJcmIiIOjrZ YPsvjB+Z+3cUb1avUd+btpWcDpf8DE4gE6ZqMxRUccyoUANlLeU1dSVFIZzwPSl/TJ Rbj+F+Zloliv8Uu/qhDdOKxLiXFA8dyEWaJhyEJnUe7pT0Xdi1d69n/OV7fq6gFI// 1/yuWKWWKwROg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 66F64180087 for ; Mon, 29 Dec 2025 18:53:01 +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=1.8 required=5.0 tests=BAYES_50,DMARC_NONE, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, HTML_MESSAGE,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-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (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, 29 Dec 2025 18:53:01 +0000 (UTC) Received: by mail-oi1-f173.google.com with SMTP id 5614622812f47-4557f0e5e60so5408366b6e.3 for ; Mon, 29 Dec 2025 10:52:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767034375; x=1767639175; h=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=vO+hsWKgOP2ctORhjV+4WOMADA2n6GXReej0YoPgbjc=; b=p66yvBt1lPiFDXk8sEEDn4kWKzS5XZCE7M+0JiWyBE57iPKWgSP/ke9R+GKG///V4h ZXUyM989jXoGb/auX4Fvb6XlL7bPUa+Y7U7iMR98o9TuXleyWyCEr6peD/IeiZQ23bOI oEhU3BO11pDl5FjmSZT8NVXaIkxrRB9l8cS/1/WELJ0CDT7by2mraPz1cMGSicdkH07a l38IJfCdo1NQ4aRnD6rfN9kR8Ej3CIKQhIH/OaGrzFQQzXatPbcDCOh1jZnmmhiEnMN+ U+OUYOwc/cbiyyzX3pAydrPrmr+diQ5ROlLUx5sCwvtjrfkDipJ+DA1LR1vMIThBMN97 z4Xw== X-Gm-Message-State: AOJu0Yx9DFNTJ+EltecDt4eDV1vgJMZ8UvGuVOPa2yCrcwrzfBVdVNL9 Ntk2SeA+HOLnnljHq+cJQS0skM0wTpLYtPc/cr0GzpF23ySKK13TVPDmAIE9QG35YreEsLVBebm Vb+JIwZc2uKjmLlTHSbdoTuZyMPCaR+WLMvTm X-Gm-Gg: AY/fxX4fVv2mVamgWiA5falTEcxUagxvMJeV3q52e07Af+cYRYYmfGwDG4vYJSWbuyv aDAIxFnmTetPEwjGDM95BD0Heqb8jO1obvA4GN6/C/nkrtRXfcf4+/DlYqhL9SYvkV4rbGzu3I6 13lyi0GZ74FMQIcEEUfzcgwhKmwX2Wg3TINPcCYWCQ0Czr/y+o4a8Sqp4zgvTC1vql75Qxyp5Gx 3vcG+CY3FFlNSQngN01c6B0kTWUexXS0R1JvfCFN3xgpTC5i2wJ6N7lK5NEELM1tAqD8LmtM7XC hawDnw== X-Google-Smtp-Source: AGHT+IErhk37HJlU5PE26IYdKyfOIhBiNAAjJ6UBYwhmbeEhLnwaFcDQ9DLDkSesjt1vjRApQWEbATrP7l9oYkVp5JU= X-Received: by 2002:a05:6808:250d:b0:455:8b5b:c763 with SMTP id 5614622812f47-457b2201259mr14007418b6e.67.1767034375397; Mon, 29 Dec 2025 10:52:55 -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: Mon, 29 Dec 2025 19:52:44 +0100 X-Gm-Features: AQt7F2pxXTK6Fulvad8mHYVW1we89Qo7ElpEoG0-ZOhxnV9-YuW6NENJORsVxpY Message-ID: Subject: [PHP-DEV] Re: [RFC] Stream Error Handling Improvements To: PHP internals list Content-Type: multipart/alternative; boundary="0000000000004065eb06471bc084" From: bukka@php.net (Jakub Zelenka) --0000000000004065eb06471bc084 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, Nov 18, 2025 at 7:38=E2=80=AFPM Jakub Zelenka wrote= : > 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 > > Hi, I just published version 2.0 which is a significant redesign including= : - Introducing StreamErrorStore, StreamErrorMode and StreamErrorCode enums (the code also includes various suggested helper methods). The code is backed (int) because I need to keep the number to easily match the category and simplify the mapping. I think that in this case a backed enum is better= . - The error data are now in a StreamError class instead of an associative array. This also simplifies StreamException which now has just a single method to return the StreamError instance. The error handler callback signature was also simplified to take just a single StreamError parameter instead of multiple individual parameters. - Errors are now grouped per operation and reported at the end of the call. This also supports nested calls (e.g. in user streams) so they don't overlap. And it delays the execution of error handlers (not just the stream error callback but also the usual error handler if default standard error triggering is used) which should be safer as noted by Arnaud. - The storing of errors is done at the end of the operation grouping and contains only the last grouped errors. So the function name was changed to stream_get_last_error(). It returns just a single StreamError which has a next property pointing to the next error if there is any. - Stream is no longer exposed and errors are not collected on streams but globally in the same way as wrappers. It is actually no longer even collected per wrapper because it doesn't make much sense when the errors are grouped per operation. - Terminal (and NonTerminal) was renamed to Terminating (and NonTerminating). - Invalid enum types for context options (error_mode and error_store) now throw TypeError. - Implemented operation pooling to minimize memory allocations during error handling (pre-allocated pool for up to 8 nested operations). I hope this addresses all concerns. Kind regards, Jakub --0000000000004065eb06471bc084 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
On Tue, Nov 18, 2025 at 7:38=E2=80=AFPM J= akub Zelenka <bukka@php.net> wro= te:
Hello,

I would lik= e to introduce a new stream error handling RFC that is part of my stream ev= olution work (PHP Foundation project funded by Sovereign Tech Fund) :
http= s://wiki.php.net/rfc/stream_errors


=C2=A0Hi, I just published version 2.0 which is a sign= ificant redesign including:

- Introducing StreamErrorStore, Stream= ErrorMode and StreamErrorCode enums (the code also includes various suggest= ed helper methods). The code is backed (int) because I need to keep the num= ber to easily match the category and simplify the mapping. I think that in = this case a backed enum is better.

- The error data are now in a StreamError class inste= ad of an associative array. This also simplifies StreamException which now = has just a single method to return the StreamError instance. The error hand= ler callback signature was also simplified to take just a single StreamErro= r parameter instead of multiple individual parameters.

- Errors are now grouped per oper= ation and reported at the end of the call. This also supports nested calls = (e.g. in user streams) so they don't overlap. And it delays the executi= on of error handlers (not just the stream error callback but also the usual= error handler if default standard error triggering is used) which should b= e safer as noted by Arnaud.

- The storing of errors is done at the end of the operation = grouping and contains only the last grouped errors. So the function name wa= s changed to stream_get_last_error(). It returns just a single StreamError = which has a next property pointing to the next error if there is any.
- Stream is no lon= ger exposed and errors are not collected on streams but globally in the sam= e way as wrappers. It is actually no longer even collected per wrapper beca= use it doesn't make much sense when the errors are grouped per operatio= n.

- Terminal= (and NonTerminal) was renamed to Terminating (and NonTerminating).

=
- Invalid enum types= for context options (error_mode and error_store) now throw TypeError.
<= br>
- Implemented ope= ration pooling to minimize memory allocations during error handling (pre-al= located pool for up to 8 nested operations).

I hope this addresses all concerns.

Kind regards,

Jakub

<= /div> --0000000000004065eb06471bc084--