Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:120983 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 61278 invoked from network); 4 Sep 2023 22:34:55 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 4 Sep 2023 22:34:55 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 9F5681804FF for ; Mon, 4 Sep 2023 15:34:53 -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=-0.2 required=5.0 tests=BAYES_20,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.2 X-Spam-ASN: AS15169 209.85.128.0/17 X-Spam-Virus: No X-Envelope-From: Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 4 Sep 2023 15:34:53 -0700 (PDT) Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-500a398cda5so3216573e87.0 for ; Mon, 04 Sep 2023 15:34:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1693866891; x=1694471691; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=A1yXR7viuP4y3X6+TlS0fd+Yq1GUEtubF6DMz3lSCqo=; b=mFbEA/zW2COuRdpb6HNEnpIrHs4srP5sfHFMCK86obE7R2Hp9frpwgjmS8DFhKQF36 3WnHj93RnqeekpjBHcjKwQ+DViwGgxwaZZ6vqUvVvF3/ESx9yoJa/A9KyS9RAaLmOVz6 Zbe7MkHPjdxvOOe4SlSR68iSYDtT3bzdhj3dpYt2GCfP2XALqlLz89oKeW4MWAIUWJnV IsTtDS7IYZibOfB1E/ovK0td+bfsJPoRnYumtWVcQ/sKcauAUJNNH848fPNo8LwHoyyG PUJU5l8O2ZYKFXqQscKLmsJfEx5yi5mFxGbP2GG+lXBrftNjRIUBAoJCXaiNU/Tbh9IL 94ZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693866891; x=1694471691; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=A1yXR7viuP4y3X6+TlS0fd+Yq1GUEtubF6DMz3lSCqo=; b=E68F6YLWXgKLmTnuu7vfv9FkV4jkZF7wWPzUIBP+e4kspqAr6KrMYU+O4dBHwJ/CJW eAEHjwotVJ/N7maD7NUYGtXBLrU1CtZFoNatU/wmjXYcgbjpZypNjf0kMmJub0E2/7f5 EMi9sJA4Sccglhv3ybTxzT2YCheSKNWhdlTVr+X8vPyne+hKCLijAB7e+3b5aN+ohEUX ep52Ok9rERMLD4vKFnka4vU36UKYGKPsevHxVmDQ2PWR0d9CI7RHfSoKQCR4+M+cpxD9 KSeSBHOukQ8TwmT7QTvQqkjSZaHy2mM6TLDcxl41Hx9+L1wptncimyukW2vEWiDGUU1J iAhA== X-Gm-Message-State: AOJu0YwnfsVchxjiRHcmSaGu0UalddH7CRsqd2pAyWUqtfA6gXFfMkVb oueJO9wFrM11yDg1TRoGCsa28Va5W4/wxg5qTxQ= X-Google-Smtp-Source: AGHT+IFAhYdeRimeuBFfIFlDpkjnB+DnTlIT637bHBXU06ABcZUjOF+i6bNXyk5OCcYNnHxGhPH0F4UCRx2NymSaFaI= X-Received: by 2002:a2e:3215:0:b0:2b9:e6a0:5c3a with SMTP id y21-20020a2e3215000000b002b9e6a05c3amr8166789ljy.48.1693866891040; Mon, 04 Sep 2023 15:34:51 -0700 (PDT) MIME-Version: 1.0 References: <7f23f0ac-bba6-5997-b737-2a252205cf85@bastelstu.be> <9a19120d-1767-6214-c728-c67a9a98f977@bastelstu.be> In-Reply-To: <9a19120d-1767-6214-c728-c67a9a98f977@bastelstu.be> Date: Tue, 5 Sep 2023 00:34:39 +0200 Message-ID: To: =?UTF-8?Q?Tim_D=C3=BCsterhus?= Cc: =?UTF-8?Q?Alexandru_P=C4=83tr=C4=83nescu?= , PHP internals Content-Type: multipart/alternative; boundary="0000000000005659c10604901eeb" Subject: Re: [PHP-DEV] [RFC] [Discussion] Add 4 new rounding modes to round() function From: jorg.sowa@gmail.com (Jorg Sowa) --0000000000005659c10604901eeb Content-Type: text/plain; charset="UTF-8" Thank you all for the comments. The naming brought some constructive discussion. My preferred solution would be inconsistent PHP_ROUND_AWAY_FROM_ZERO and PHP_ROUND_TOWARD_ZERO as those are friendlier to the most of developers and are not possible to mistake with other modes. I would go even one step further and create aliases for NumberFormatter constants to have the naming consistent. > 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 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 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. Kind regards, Jorg --0000000000005659c10604901eeb--