Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130167 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 76F4A1A00BC for ; Wed, 25 Feb 2026 12:38:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1772023086; bh=0Am2H1LqY9gbyDoCtJvj1o8gXUOKpVOjYQM+hCCxH8I=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=iO+lWmYxU9Xb6jrlQpUAj03yL7gSyTb0pflzJaNwRnlU0qzPFN8lid0NYxA1Fy/a+ VpnpPR4lpRaKbSYoP+oKEdDJiKXU+BLAewfKtCixzuq2Dr8N3Xf0IiLdidsT5ckOY2 jDBDusfQnD07rWxOAjbUnGrrWA+yVKNJDOhbUnq345iiIpv5mdtfHIPm/zZaTAnO2i WOvBSDZrM3aILPYbYfvxVDMPsWDbN69aH/81O1bUuQUXh85rPgDNkW6AnnICWpDoDr S5X0Gj6yko0FqXtAlbGBL6fyvqc+R9MYUpbJZa9vJ7W9YFitw6mb6FCWdVvPZziIKY CPSVLhjEq8eDA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 45CCB180040 for ; Wed, 25 Feb 2026 12:38:06 +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.7 required=5.0 tests=ARC_SIGNED,ARC_VALID,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-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (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, 25 Feb 2026 12:38:06 +0000 (UTC) Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-38709888abbso52902311fa.1 for ; Wed, 25 Feb 2026 04:38:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1772023080; cv=none; d=google.com; s=arc-20240605; b=AJimrAmm8ryObjf1UOmwT7E4KDAKzbDCKc7FLYzvXYW+9cnIaiow8iZ9D4ZochzwDR 999rpQqKI8dfdFsEabg6a5m16kEl+lpmaMLbQBm1nRITxyzNmvSFJTq5+3txq7Xn45CS uZyLXTftjzOOdVYnuH/hr9R6qupubWo951YnuNU+uD5zK4xCmQeAHAVpi+K1E8Yjdu2I K7znd1v7V/PszYLYBjKcLcia798YhmQcrPrVEf0734c1LQhIkOLS+KWhTb30g5HkDqGm oZsg/a6Uz39oM9ZX7lAQPFHI+gihSChenrGlg8XMoW8c6bkIq654BVx3i1Y0RcgZB7GD haig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version; bh=/fH0BmOsUloIlJAj8ld9PYcnIeAhh4dyT54W8Ya5Pug=; fh=ILWU9sG2Ix9rHBcioBlXuqAv64287426TUr5V8yEnjc=; b=ZWizmBlco2NPoyV2xsKaIW9lNNJc45tICB/AlW44Thdoasx/WwGvQd/tIXune9rKL0 lWvJorchpUhEVX1nKjvJ9Doow3af/KdZte+QT/V/js9ETxw8JEg1WHZZfnbl0sT69l3L rWgP6Gd2cCTaYDR5D8FArk3an/p0S8Ule/fZPpzFcyl3cYFPq8Gg2Q5D0CTMFJwhB1Wl eJMbbyUyVWh+B7lIWbiSg/kJslFHY3Zyzhj/mD5l97lf4xHsxp6MrTdtPbf09StMu7Wg WUCxSaO6O34DxD91p8nYEhF8iuZ92Jr6dTSNd2szv+gJnaJ2D+uSN+hepqMJgPqg1YDF Qn6g==; darn=lists.php.net ARC-Authentication-Results: i=1; mx.google.com; arc=none X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772023080; x=1772627880; 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=/fH0BmOsUloIlJAj8ld9PYcnIeAhh4dyT54W8Ya5Pug=; b=SK8z+0odoEfZCgk8yHW45F9zSeiNc7yRqB8P8+7qfX+CEPy1BpGIoSHKv/MG3x6eK+ rWx76HVCh5wa0HUJw6QvfYqcCq3KpbxRbpkhfpFxjBNqAypBL2EY7YhCZk419hnwEmcX ngzspLg3U/yw0P8VG0XC9Oq12JYtwni8IvD6GTGoz0Q3voFoMCPV0jJsGRia1zsWAEfd iu9KP9Qq3eU9IGK9f7BWMrb1IvcS+K9SmOCegOFVcfJRmMTxijFDkoDDsr3BmmmUmM9j 9CTvt+Kj3SxJnxDXF07kvZ8RJAbhTZrkCwAk34nsHUkAffvSDhWvtV3FbOC2cqKzfbBK UKZg== X-Gm-Message-State: AOJu0YwXB4r+hdzfx2WSP2wAAW0ZqtjJp/lfUDM0J/Zk5PctcLh91CFW j9jMMdJFSx3Ir+AflLYBHSA7DTbNB3iPSuIyLisc9jnh8nZz+iV/rzofzzvq0x6+RZ9dQ64palb ZKjzS7palBQBClwK4zOZ1crvlGWB01rEPqw== X-Gm-Gg: ATEYQzwVuCU9AwOBLINKU+tfuh7om5HsfeqNv56Sk5Ti6OxBlQD36zYPO4TpVFR+hzJ RRLsArXsWQkgAQ1kU5jwJ4nFHtkFqb+4duZwd6QYDGAt4cmHknmIBwe18L3oevKSIRyfkC+gxVu Im2yKWPrYyCL9Ryiv4QoiJwIjE0ap0EVzjHKKf3DpWRVq3JER4qGKI0aGqYParqaZSx4PlS41vf FHbstSnN1tsygxI8N0XIwBw9e0MEy8Ku+/ebrNHsehOGUep3/qXerScOtTG6Rkp5jseMI3BXDQt MAmjjYk= X-Received: by 2002:a2e:be9b:0:b0:387:197d:2073 with SMTP id 38308e7fff4ca-389a5e9358cmr52218291fa.40.1772023079282; Wed, 25 Feb 2026 04:37:59 -0800 (PST) Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 References: <36066994-5b15-4b96-88db-47ab4bf92376@varteg.nz> In-Reply-To: <36066994-5b15-4b96-88db-47ab4bf92376@varteg.nz> Date: Wed, 25 Feb 2026 13:37:47 +0100 X-Gm-Features: AaiRm53mDSgqn7PTxD3FtDLIDqn89GU_H6K5HiQVX9kDWcI3PRKf9a41JduMsdw Message-ID: Subject: Re: [PHP-DEV] Re: [RFC] Stream Error Handling Improvements To: Morgan Cc: internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000002cb700064ba54627" From: bukka@php.net (Jakub Zelenka) --0000000000002cb700064ba54627 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Tue, Dec 30, 2025 at 12:25=E2=80=AFAM Morgan wrot= e: > On 2025-12-30 07:52, Jakub Zelenka wrote: > > > > Hi, I just published version 2.0 which is a significant redesign > > including: > > > > - Introducing ... StreamErrorCode > > enums.... 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. > > > > Just spitballing here, but perhaps a StreamErrorCategory enum? The Code > could have a method/property that matches it to the corresponding > Category; categorising errors of different kinds can be done by > branching on the Category, rather than (possibly multiple) is*Error() > tests. > This is an interesting idea but it wouldn't work because some categories are overlapping. So is*Error functions seem better fit here. Kind regards, Jakub --0000000000002cb700064ba54627 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi,

On Tue, Dec 30, 2025 at 12:2= 5=E2=80=AFAM Morgan <weedpacket@= varteg.nz> wrote:
On 2025-12-30 07:52, Jakub Zelenka wrote:
>
>=C2=A0 =C2=A0Hi, I just published version 2.0 which is a significant re= design
> including:
>
> - Introducing ... StreamErrorCode
> enums.... 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.
>

Just spitballing here, but perhaps a StreamErrorCategory enum? The Code could have a method/property that matches it to the corresponding
Category; categorising errors of different kinds can be done by
branching on the Category, rather than (possibly multiple) is*Error() tests= .

This is an interesting idea but it wo= uldn't work because some categories are overlapping. So is*Error functi= ons seem better fit here.

Kind regards,
=
Jakub
--0000000000002cb700064ba54627--