Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120997 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 35984 invoked from network); 6 Sep 2023 17:40:52 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 6 Sep 2023 17:40:52 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 2D115180210 for ; Wed, 6 Sep 2023 10:40:52 -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-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Wed, 6 Sep 2023 10:40:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bastelstu.be; s=mail20171119; t=1694022050; bh=WRDzsfSjeLYSJFli+L2OGEjVP8vQWykXtrnR3iUfJ9A=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type:from:to:cc:subject:message-id; b=kaXRbmxOKVsKsD0gvuJ/tenvm9JIdtAb+qsnOoOf1tZgfYegWePVTQ+4Y4D3Bn9BC SnVpMBbD4wLv3r/ZLPKYELpfs/W0hcnyI+U8fB4d7M1sOd0/GPqelmcjlwF58ejDxL kt7i4c+i/qH3KMASRfp3bWupMNdlgdHdPSnDEUkN3pv97471G5ku+Y5ODl7uoBXO96 LtcSEXZ3ZgUG4ZkUcq1JKFEdqYp13+yHrDV+n9CRTkCzS1jqXgdEWe4ohmWiWMw6Jm tAvwGRtwZWic32Hzezc2yUtsa3rpJjPJZSFeqSwrRJd6+gHVef2nzOeixrMVhDMBl+ 7GscIdIgtv1tQ== Message-ID: <606297dd-8964-7df4-df67-579f1b2f37e8@bastelstu.be> Date: Wed, 6 Sep 2023 19:40:48 +0200 MIME-Version: 1.0 Content-Language: en-US To: Jorg Sowa Cc: =?UTF-8?Q?Alexandru_P=c4=83tr=c4=83nescu?= , PHP internals References: <7f23f0ac-bba6-5997-b737-2a252205cf85@bastelstu.be> <9a19120d-1767-6214-c728-c67a9a98f977@bastelstu.be> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function From: tim@bastelstu.be (=?UTF-8?Q?Tim_D=c3=bcsterhus?=) Hi On 9/5/23 00:34, Jorg Sowa wrote: >> Introducing a brand-new RoundingMode enum (using union types) I >> suggested in my first email would nicely solve the naming problem and >> would also make the API more obvious to use due to stronger typing in >> the long run. > > That's also interesting idea and I would push it, however I'm afraid about > the naming of namespace. I recollect some of the RFCs were rejected simply I didn't intent to suggest putting the enum into a namespace. It would be `\RoundingMode` (i.e. within the global namespace). I'm not sure how you got the impression I suggest a namespace. > because of the namespace. If there is a guideline for the namespace of core > functions I would willingly get familiar to it. Otherwise, I don't want to For the reference, there is a namespace guideline here: https://wiki.php.net/rfc/namespaces_in_bundled_extensions It doesn't really apply here, because `round()` is in ext/standard. > open Pandora box only because of the namespace of Enum. It would also bring > BC to the function, unless we would accept both enum and old constants. > Yes it would accept both the enum and the constants. In the long run the constants could be deprecated. Alternatively the constants could be aliases for the enum values, but this might break compatibility for users that use the raw integers instead of the constants. While this is "not a good idea", it might have happened. Best regards Tim Düsterhus