Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127235 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 4A8051A00BC for ; Mon, 28 Apr 2025 22:36:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1745879678; bh=H9YRP2M2HW5d/H6i0ZVANJ7T6vEZTJunzSdbK/iaY04=; h=Date:From:To:In-Reply-To:References:Subject:From; b=DU3sXzI1DyNAUsesHybFPygaIlvnl/7vYIBdgoUIh3C4n9YSwBjkaHJTIb6v/u+jL ihQEBDxcJ7IrLmu0GJh/vi+89/XawwZ4H21tuuK5fHtyxeCFA9VAGSMoDq0s0KldIY +SRenv44xF8EVoBCiOqaQkU5aLEmX+aMqcczBEx+Ak6CAIBWK3G0p8a5J/E/hWu2AT nNXUchNK+wYW1kUTpkOWlN7deBa/+vrl0D0K3EkvMssDrvBS81tgbNMkbHTWzAKVuG qv+YeBfL24D2kUL0uPA8NXIjeT7zGtXnBV9i1FYEDeDy6yzV2zb8hSdLy8EbK4ywye PCioA4DeO4Aww== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2C5591801EE for ; Mon, 28 Apr 2025 22:34:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fout-a3-smtp.messagingengine.com (fout-a3-smtp.messagingengine.com [103.168.172.146]) (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, 28 Apr 2025 22:34:36 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.phl.internal [10.202.2.50]) by mailfout.phl.internal (Postfix) with ESMTP id 632F613808DF for ; Mon, 28 Apr 2025 18:36:53 -0400 (EDT) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-10.internal (MEProxy); Mon, 28 Apr 2025 18:36:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to; s=fm3; t=1745879813; x=1745966213; bh=bc8sEaP38aBrwFqqwJLpQ pM1mcbdAs71HnklCZIoHb0=; b=drYcYJAFIi8roKO/hoX4q/xYOZC/vKmCr3c7m rbEXgmXOfLoDSndrTpWqr6ggWiZDLCtgdY+92rsv1G6g5yYo0+KDeDGjn65Sd2/T ecrYJyAl9F0wP1gJXc1FNDpN4NbkM46oKRUDyOGK8de5QaWo0NX+DCOIcJ7R/16a P0+SNBJFNgW4OfeUcNodFt8uCOd71kE+m1GqS1ahENdIrmhZ20E9Nx2pfhECV5VC HN4SmWzGs07iLtj9NhLRBv7CIWYEDgxTSfQ2+7eySh/niwZ4z10v0KaVvAn4r6IZ 2TYdTIf0lXYGbfzwy9GzZW083AOPh5bUj+2dCbLGipraRQhDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; t=1745879813; x=1745966213; bh=b c8sEaP38aBrwFqqwJLpQpM1mcbdAs71HnklCZIoHb0=; b=Yklpc7tCG+IiSG2HE sAX5fs95cxNPw/oKsfsDRGQbKSsVmidY+AJ9UoW4lO9FpZSnscrYmSCFZcAOCzLY KSdUYVRH+q0FQqYMNt5WO7Sx9/nZza4wkTro1Q+SUFAXGCY0ryXEYnSIdO9plbtc juR54TE4tQAL/BrcOYZysl0di0623Rg66amFims1WwXncT4LcQPOK//gOT1IJu1Y RXsIkDRUk75IQrKPNKdUY041Lv1z5dyDZ1Vue8E+rVpDlix+VZDFXBGp3+6he6tM q3ozRvYJWo1KQ7XD/LAr1gC3a7vvwM5idpDy5PERd2YInyvuRku43rQg28/H318S qpYEA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddviedvudejucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepofggfffhvffkjghfufgtgfesthhqredtredt jeenucfhrhhomhepfdfnrghrrhihucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrh hfihgvlhguthgvtghhrdgtohhmqeenucggtffrrghtthgvrhhnpeehjeefvefgfeduteff ffdvheeiudekieefleevvdduiefgkeehvdevheffvdegteenucffohhmrghinhepghhith hhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhf rhhomheplhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmpdhnsggprhgtphhtth hopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehinhhtvghrnhgrlhhssehl ihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id F188129C0072; Mon, 28 Apr 2025 18:36:52 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: T3339c68d3b5f96f0 Date: Mon, 28 Apr 2025 17:36:32 -0500 To: "php internals" Message-ID: <22c056ae-4f54-408b-9146-748ec0e52878@app.fastmail.com> In-Reply-To: <39af290b-358a-45f4-9d2d-c76dd4e08125@bastelstu.be> References: <8c35314a-e307-4018-8685-39d7a7923cbe@bastelstu.be> <4de85c52-9c04-4e66-9654-af1a377015e1@app.fastmail.com> <39af290b-358a-45f4-9d2d-c76dd4e08125@bastelstu.be> Subject: Re: [PHP-DEV] [RFC] Throwable Hierarchy Policy for Extensions Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Mon, Apr 28, 2025, at 4:27 PM, Tim D=C3=BCsterhus wrote: > Hi > > On 4/28/25 23:09, Larry Garfield wrote: >>>> * Would allowing an extension-tagging interface instead of a base c= lass be an option? It still allows for catching "anything thrown by thi= s extension", which I presume is the goal. If not, why? >>> >>> See the =E2=80=9CChoice of Base Exception=E2=80=9D section in >>> https://github.com/php/php-src/pull/9220. >>=20 >> That seems to be about not having a common interface for both the Err= or and the Exception, which makes sense. I'm talking about `interface E= xampleException {}` and `interface ExampleError {}`, instead of `class E= xampleException extends Exception {}`, etc. > > Besides not following the de facto standard (which is what this propos= al=20 > is trying to codify), I'm also not sure what benefit an interface woul= d=20 > have over a base exception for the problem we're trying to solve here?=20 > So I can return the =E2=80=9Cwhy (interface)?=E2=80=9D. It would just = make it tempting=20 > to extend some SPL exception :-) It's a common recommendation in userland, as it allows implementers to e= xtend an existing exception (eg, InvalidArgumentException) of their choi= ce while still being tagged as coming from a given library. Though I su= ppose if the policy doc also says to never do that, that becomes an irre= levant consideration. --Larry Garfield