Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:121207 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 51253 invoked from network); 2 Oct 2023 17:23:33 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 2 Oct 2023 17:23:33 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 0D7061804B0 for ; Mon, 2 Oct 2023 10:23:33 -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,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-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Mon, 2 Oct 2023 10:23:29 -0700 (PDT) Received: by mail-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-5334d78c5f6so22667823a12.2 for ; Mon, 02 Oct 2023 10:23:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696267408; x=1696872208; darn=lists.php.net; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=oORQcxouUIMPFdRzR0bp3baQi6gbwBkcKH+KPl/9oV8=; b=boI9OtJ14x6ZbPvyZZIVGmamgXY7IkxXP5W9oBF8VBhGvCND/qAbJHDOY8H4n3nAiP pTIoIazpwq7lKVi5GSkXhR2fezz5qeJUU+lXHmK3ut0aYLjaT+cKlfl/4ZEpJveqWlh9 We/vJE6ux+U1+sQ7pfglTr6lYPWFnbrPDFk5m9bGZGezLBo67vFaGf4eR94Vpt5C/peQ vE4Wdx8nUwNDgCUV3nJiXSrNNGpjJT4wgmYiZGt86qPo6GIUuvXlVIOAjXqli0jlVr60 kik4QIY5TCCfR/FIgoIzXi3zzzJuaeXRbzRZRpLtvNfXxcEWbvX7HQxNEl29n/mAkJWm 8Syw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696267408; x=1696872208; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=oORQcxouUIMPFdRzR0bp3baQi6gbwBkcKH+KPl/9oV8=; b=F9j4LzDVJ0SysalXh4eeJ5LDSczo5ZCx1MSj/WikQb2sh73Zrydby0tCA7oKavaxzL T2r/WwlwUUFZqys/+AqZkGLpq4CQY1ajKkKLtq2Q5v2IDgmUPc+3mGg+9H5pr1APKucC oLf2+DDcW3ki9hOLiKlUHeBYQvTFoG8LHVpO9MS5VJQt0OWdTrd35EOTfAOsgxn35cC8 JsaAu6m1W1wJ0DC9ZX+iAYfP6zRYd39zxrtqlhyvLhuP3rFtuRClIRP112Ck5QnsNmJU CsNXSX+xJrbypntPZjgpwkzm92CP6ksgFtAMjfI3zP3hjQjNY7AFKMCZwhUsUvfBGwoB C2QA== X-Gm-Message-State: AOJu0YxhancJ7Mmtg4Jn04zLssSeO3yhBYmpGgvlrqiCL1o7I6hALLRe MVjMo8qUYWkWU8RrdvtiLPnBCsW783U= X-Google-Smtp-Source: AGHT+IFrKqRX3zO7NW/2q6QTt1BcBz4Pw7aCKQErN9GZ7FSa6322qZvRcvUGaM30VhR+CVIFunxASA== X-Received: by 2002:aa7:d458:0:b0:523:1e0a:e12e with SMTP id q24-20020aa7d458000000b005231e0ae12emr10856498edr.23.1696267408058; Mon, 02 Oct 2023 10:23:28 -0700 (PDT) Received: from smtpclient.apple ([89.249.45.14]) by smtp.gmail.com with ESMTPSA id x18-20020aa7d6d2000000b0052febc781bfsm15736270edr.36.2023.10.02.10.23.26 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Oct 2023 10:23:27 -0700 (PDT) Message-ID: <9361B7A5-82C6-4A25-9524-09CEEE1A6CE4@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_49381D22-0303-48D3-86AF-C496CC2D9D02" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.700.6\)) Date: Mon, 2 Oct 2023 19:23:16 +0200 In-Reply-To: Cc: PHP internals To: Saki Takamachi References: X-Mailer: Apple Mail (2.3731.700.6) Subject: Re: [PHP-DEV] [RFC] [Discussion] Adding bcround, bcfloor and bcceil to BCMath From: claude.pache@gmail.com (Claude Pache) --Apple-Mail=_49381D22-0303-48D3-86AF-C496CC2D9D02 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > Le 1 oct. 2023 =C3=A0 14:35, Saki Takamachi a =C3=A9cr= it : >=20 > Hi, internals >=20 > I would like to start the discussion for my RFC "Adding bcround, = bcfloor and bcceil to BCMath=E2=80=9D. > https://wiki.php.net/rfc/adding_bcround_bcfloor_bcceil_to_bcmath >=20 > Regards. >=20 > Saki > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: https://www.php.net/unsub.php >=20 Hi, Some remarks about the paragraph =E2=80=9CBackward Incompatible = Changes=E2=80=9D > These are new features and do not break existing functionality. >=20 > If I had to point out my concerns, I would say that code that = satisfies the following conditions will cause an error to occur. >=20 > * A situation where the user has defined a function with the same = name, such as bcround() This is a real concern. I have personally defined a `bcround()` global = function because I needed such a functionality. A quick search on GitHub = shows that I am not alone: = https://github.com/search?q=3Dbcround+language%3Aphp&type=3Dcode=20 >=20 > * And, the existence of the function is not checked in advance. If the existence of the function is checked in advance, the BC risk is = worst, because they cannot have known whether the signature and = semantics of the function you will introduce will be compatible with the = one they have defined. In case of mismatch the eventual breakage could = be more difficult to notice and trace back. Note in particular this SO question: = https://stackoverflow.com/questions/231057/how-to-round-ceil-floor-a-bcmat= h-number-in-php, where the second answer has a different rounding mode = on halves than the first and third answers. Fortunately, the few examples I have seen don=E2=80=99t foolishly guard = the definition with `if (!function_exists(...))`, so that there will be = a hard break when upgrading PHP (static error: function already = defined), and they=E2=80=99ll have to decide explicitly what to do. In my case, I=E2=80=99ll wait until this RFC is accepted, then (and only = then) I=E2=80=99ll decide what to do depending on whether my version of = `bcround()` is compatible with yours (either rename or = `function_exists()` guard). >=20 > However, I do not think it is necessary to consider these matters. I think that it is necessary to acknowledge that there will be breakage = for some people, and to decide explicitly whether this breakage is = acceptable. (I think it is.) =E2=80=94Claude --Apple-Mail=_49381D22-0303-48D3-86AF-C496CC2D9D02--