Re: [RFC] [discussion] Correctly name the rounding mode and make it an Enum

From: Date: Mon, 03 Jun 2024 18:11:20 +0000
Subject: Re: [RFC] [discussion] Correctly name the rounding mode and make it an Enum
References: 1 2 3 4 5  Groups: php.internals 
Request: Send a blank email to [email protected] to get a copy of this message
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

Thread (27 messages)

« previous php.internals (#123498) next »