Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:127236 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 CB66F1A00BC for ; Mon, 28 Apr 2025 22:56:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1745880860; bh=i8KN2q0iNlxNrTzXscqXVg9Vws5o2A0Tf1biHvwberE=; h=Date:Subject:To:References:From:In-Reply-To:From; b=W8H/OkFj8y+f4oKgBo7h1lkN5nTRbmKk8SWeq22Owo6C5o7ZlhDYH4LZliOXsYlXg qSkqdG1vewJQNBcGVom3SYj9WwaNwjHSt1OQOf2+6XY8BoK7worm+2hzN0LqHlGCHj zzNR3X0WUx5ITHA9O1xRu0dFM7iFtJlnDMFYX28WG8uH4HffmX9+zx1dGCXRHY/Xx9 Z3m452799UDgrYnWzdZEwDvpekGGQyzupPBBQHJ5fgOu/zjZGEdQ/3VmyFWLDHljPc /pwLkUYkQebylkQyorPAdQCqAoj6uUoPt++SfaxOi2m3a32r4Mnm+XWRulagaJjjbj fD4KcNh9tLfPw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 83C58180081 for ; Mon, 28 Apr 2025 22:54:19 +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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, SPF_PASS 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 chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (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:54:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1745880994; bh=CFVdq6oqOvyFcTVVDdg39+3Ul7T4yQJzBxjHxFtNSkQ=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=ZpA/AT3gbQJ2tqFgp4ZNHs2ttg6u0p2FiuuCESCv/1bDjjDDg+WHfeAZCeQJsk3s6 PBDq3YLHiMbO+KB9ADJINrlnJiShrsLAAIxNp/djXpUghvQzfiKbXRkuD01t/3sygw DsiMqH4DSDnUUFie8BeJtvQ+eW1yqVyzrBe1Sr4SY3suwS9KX6SoHn6wGQV5D+pwE0 rQhB3xR7k9BSKp6A3whzEZloB0+29zilC5nsiLDHqivD+s3XUa0JHOM4+zWu1AcMKe 3hmqoc5MlHGhA5uf4Vk1IQ35MoOAg4VpMDhc3L9Uy8YFrSgLp/6FYBJxNaAbajhYmy 8l8I1PRd8Vj7w== Message-ID: <30317095-dfd9-4528-a97d-a8449bf4c517@bastelstu.be> Date: Tue, 29 Apr 2025 00:56:33 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] Throwable Hierarchy Policy for Extensions To: Larry Garfield , php internals References: <8c35314a-e307-4018-8685-39d7a7923cbe@bastelstu.be> <4de85c52-9c04-4e66-9654-af1a377015e1@app.fastmail.com> <39af290b-358a-45f4-9d2d-c76dd4e08125@bastelstu.be> <22c056ae-4f54-408b-9146-748ec0e52878@app.fastmail.com> Content-Language: en-US In-Reply-To: <22c056ae-4f54-408b-9146-748ec0e52878@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=C3=BCsterhus?=) Hi On 4/29/25 00:36, Larry Garfield wrote: > It's a common recommendation in userland, as it allows implementers to extend an existing exception (eg, InvalidArgumentException) of their choice while still being tagged as coming from a given library. Though I suppose if the policy doc also says to never do that, that becomes an irrelevant consideration. Yes, the SPL exceptions are so awfully generic that there is no value in catching them, since they can refer to *anything*. And when you can't usefully catch them, then extending them doesn't make sense either. And a TypeError or ValueError is a clear programming error (failure to check preconditions), so that it also is incorrect to catch them. Best regards Tim Düsterhus