Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121255 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 55036 invoked from network); 6 Oct 2023 18:45:26 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Oct 2023 18:45:26 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 3D6D418005C for ; Fri, 6 Oct 2023 11:45:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-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,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS24940 176.9.0.0/16 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 ; Fri, 6 Oct 2023 11:45:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1696617923; bh=lqBEDa6mXloFBvLQZIpl7WQ8jL8qwZAPkFdEUvEwKD8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=VqiYA0rxbFA+eBhD0hgzXviD2/lAX7Ms7JhEgRb4pDY9Eyn1kVwRIFDaEEccdjG9e o1rBM3s19e3fnkNQiiWqbsVe9TB97Bd21ILPpySrGXmgQSXYmOsK+c8cNXb2VAtg1J x407BIO4R42jTjZMj9IM492a6SiFup9Mw5NpXY4Ell6Ba3BNyLAatWs4FQ+rwPBQe6 xqvMwHCj77xelAkgO8HWXeCojsAyIQj2VqBKuSdM1I9NDJIDRbX7DBBgx+bsblvS6z U8eMsmhppLwD21tVagI1qBSNcNhfFH3DKZxXD8MMQNV/DxWB8vC8u+KDL3p0iSQLWN yDxoSATQO61hQ== Message-ID: Date: Fri, 6 Oct 2023 20:45:22 +0200 MIME-Version: 1.0 Content-Language: en-US To: Jorg Sowa , "G. P. B." Cc: PHP internals References: In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] Re: [RFC] [Discussion] Add 4 new rounding modes to round() function From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=c3=bcsterhus?=) Hi On 10/5/23 23:37, Jorg Sowa wrote: >> I will also echo Tim's idea of using an enum instead and a union type. >> For the namespace, I think it would make sense to use Maths\RoundingMode > > Doesn't Math/Maths namespace introduce BC break? > Why do you think a namespace would introduce a BC break? However I'd argue in favor of an enum, but within the global namespace. i.e. just \RoundingMode. https://github.com/search?q=%22class+RoundingMode%22+language%3Aphp&type=code only finds namespaced versions, so this should not be a break. If you prefer not to introduce an enum, then you should at least add PHP_ROUND_HALF_AWAY_FROM_ZERO as an alias for PHP_ROUND_HALF_UP (and likewise for HALF_DOWN) to make the constants internally consistent. Best regards Tim Düsterhus