Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123498 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 4E3B81A009C for ; Mon, 3 Jun 2024 18:11:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1717438347; bh=4yXAmtfkCKTYGEFxmcHuoLZ6u0u/7PLAuFtAw9NE6UU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=gqlkCjb3Kqie3tSJJSUcEWmZ+snbP6AaalrFFFdprdn3yqsR+j5mtCe9OqpuntWkL 4Is43WDwJ2zrA0cy4qwgR/+zkUSkF1+5G+Wm6TMlJm55+TFNiZM/4wAib9WrPg3Pv0 UY/Z+/QbxMWXYh0hn75EIC+C1PfJAqr84HY9W09uQCPBO5nx37NtyWQEbpyn00YGMG nBXaIw+jpxo72fSQVLuBN+pAByVZCN9t+c5XAbBJlWg4RpivsILAsU8cqbKn6nhi8M wuirlJDyttjzI7WUa0OfEDczV3o9jM0viBXy4hlvr5Q/e7hjQ+cKosDXwfCoPmwFuL FskubYof5R3Lw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0003A1808E7 for ; Mon, 3 Jun 2024 18:12:26 +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=0.6 required=5.0 tests=BAYES_50,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: 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, 3 Jun 2024 18:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1717438281; bh=UflaKUpHMfa5XMmcm634zqaPnx15dgn9Vdtl2BcPmzw=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=eGPYkMdF5ICg6DRkDTQAFSm4xY77jboXBj0eq5w2CbwvlgFmfc4MY2GnOVIW50qBh u8o0PXFXwPP662zCZ3T+UmklQP8KXbow4csyExE/ipvoHZAexMgDmuiLZanrEzcEYv ZgNeDu6+XcTVq7ucoi2L0XHjQLHwxPL7rpYqSVx14yxQLocyPI8vqseF8cKnSeP+ug F9kau+0XnNZwlUz2RCHlNsmNsLOfTe+J2rjai9F37MmWwyW/Mn2FKzL7q2+WKPWFxV h128S9gvImaKcz7/d2ZloTwZtKojNLp7xYrKWFZnTYXji3fcCYk/nXGzT4axC0iOHe ZK2oOsGXLW1DQ== Message-ID: <71e8bd9b-3dcb-45e3-966b-9eefe567efa5@bastelstu.be> Date: Mon, 3 Jun 2024 20:11:20 +0200 Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Subject: Re: [PHP-DEV] [RFC] [discussion] Correctly name the rounding mode and make it an Enum To: Derick Rethans , "Gina P. Banyard" Cc: Larry Garfield , php internals References: <81CBE5A8-9FAF-40DA-8EAB-9F19C2278E75@sakiot.com> <73ae49a3-473a-46f2-add6-164b0a01e357@app.fastmail.com> <5iUDJtfp_0xWjhfj9MpeJhmZz5awy0RyBF3udkM1TjF5HRfbMKoZrqVNJJWM_g07J1oLDZxsJh_6WbGEaqdNj6ZiE96SjLhfv_r62YTMiRo=@gpb.moe> <93f6b448-7c7a-5c64-3d29-f96452c9d686@php.net> Content-Language: en-US In-Reply-To: <93f6b448-7c7a-5c64-3d29-f96452c9d686@php.net> 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 6/3/24 18:21, Derick Rethans wrote: > But they're well established in existing PHP features. That does not mean that we shouldn't attempt to do better for newly introduced APIs. Over time there will be more developers that will newly learn PHP than there are developers that already know PHP’s standard library in detail. Of course that does not mean that we should break consistency with existing functionality without good justification, but in the case of the `RoundingMode` enum, the enum is self-contained and with the addition of the new rounding modes in PHP 8.4 [1], the existing `ceil()` and `floor()` functions are redundant with the capabilities of `round()`. Anyone who newly learns PHP would get all the functionality by just using `round()` together with one of the self-explanatory rounding modes provided by the proposed `RoundingMode` enum. Best regards Tim Düsterhus [1] https://wiki.php.net/rfc/new_rounding_modes_to_round_function