Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123019 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 qa.php.net (Postfix) with ESMTPS id 5D3531A009C for ; Sun, 7 Apr 2024 16:45:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712508359; bh=IQMO7au5BsAC3Rjwk+D1XrS9Ll5Dp/u8/SPqLMujpVw=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=OQYTMqopW4R9ORaCBU9bzBTxORAYza7ojD/flF1PkRoLLCal6hCtoL2WI3oU2LP3p Jh1lNY9ryMDt5ACWsOiY4oHf0cBSUuezjgkWThiGtpobpHK01LuXpWtDpz4YXk/phB 8woGNcA6UXShcpzquXsoa4uqfXIO+1/NRC1WtwQ2mS9d1UdtrZwcmE3U/lIbnu6fS0 TrHRBkPe5oXD1EhbMbMR5EoscUa7gCyRQSIGXkcELvV0MUFfe0gzRoRyATuQkD9JXo cgzWV9G8wT1LBmtTPwZk97hnOtZjEeBol4CSN8BmJGB4bzf1zoMBUZhKmGqxOqkrUb q3DzPTFrgecYA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C710F18005D for ; Sun, 7 Apr 2024 16:45:58 +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,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from chrono.xqk7.com (chrono.xqk7.com [176.9.45.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 7 Apr 2024 16:45:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1712508325; bh=t23fv9y7jTgYPGeVnapUN1sQF6zH2m6Wd1zLOCMoNVA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=nliK4pCsLnEh7fwWOuvRl2moLIYjcnIhoyW5vfdY2w/pUso4kmGYCAseOqeiXAfmr NJSgKJwmkC2tBH8AkjSpodixc6k/2gGEYpAO/TYJCUtlpbLuxRTGhehonw4sP3J2Pf GFsTLWJEHfmj35L15u/95H1LfaMlQLjfTGzRSXHyDiFzHIxNOu0PojlywSz5r3bLAU 258LkdGzZmm6CmuaKuu3KGN+LKZFnKUnFPaL6FiUgS4H42We6uVO/tgPdtgqFEMHc9 CjedtS75d2ORh8VhW9qmUhXrKWOKO1e5x+tKLXxWxUV4zLXn5wjy28WDymVzgr3BoO wtdCY4rb2J2CQ== Message-ID: <36a96673-cf7b-4ffe-a86f-ee470d95a39b@bastelstu.be> Date: Sun, 7 Apr 2024 18:45:24 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath To: Saki Takamachi , Derick Rethans Cc: php internals References: <4F094EDA-5058-407D-AF39-06FD934FDE1F@sakiot.com> <68CF373E-6ABF-4471-8992-813B4BA1B508@sakiot.com> <62e27e46-f911-5a71-6527-8bba21bf0964@php.net> <48803EBD-33BB-4433-B125-448759A81868@sakiot.com> Content-Language: en-US In-Reply-To: <48803EBD-33BB-4433-B125-448759A81868@sakiot.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 3/28/24 14:30, Saki Takamachi wrote: > Thanks. Sorry, I meant "If I create dedicated exception classes, do I need separate classes for each type of error?” I couldn't write it well in English. To answer this question, even if it is not necessary after all: You should create separate classes for each type of error the user is expected to handle differently so that developers to not need to check the exception message to find out what the error was in their code. Here's an insightful GitHub comment from Danack: https://github.com/php/php-src/pull/9071#issuecomment-1193162754 And here's the PR adding a proper Exception hierarchy to ext/random: https://github.com/php/php-src/pull/9220 For ext/date, here's the RFC adding the new Exception hierarchy: https://wiki.php.net/rfc/datetime-exceptions. If I remember correctly, the choices made for ext/date followed the precedent set by ext/random. Best regards Tim Düsterhus