Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124101 X-Original-To: internals@lists.php.net Delivered-To: internals@lists.php.net Received: from php-smtp4.php.net (php-smtp4.php.net [45.112.84.5]) by qa.php.net (Postfix) with ESMTPS id 4A5261A009C for ; Sun, 30 Jun 2024 14:52:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719759205; bh=85827dlZJkaCOxXYCT5nEG9cysOaIfp4bUDEIqSEAcU=; h=In-Reply-To:References:Date:From:To:Subject:From; b=ZRG6VObGaLdhcCmQHQ3t/EeId/SPNoekI88qCj1v9EUCKeuDVEbUpP5yjcfy09WKa bY50wweI7k6VAzKxiBsCG8EjZ7CZfo3sdh50R/9ugiAJVfb73IpYA9hE15YisKyvbu /YVwiucbx4T/+1HmpY5q59qJAGrElb5toOOdXnUxPLxtTHCLEE9SRNp3m8ZNJ2Tgtr VeslMt5vx6z0boO1g0fILHPClDpbM5eoCeoUtBCpDrNB9lyBENosf1+KZ1xup8u+gT K5MMPCk3KJlhSqf4OwHQm6RhC7eKe0URG9qLu/h1zWfr8AOMpROd6hxu90BdAIfMTn NpUMf92Nv5YrA== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C4CF2180787 for ; Sun, 30 Jun 2024 14:53:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=BAYES_40,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fhigh1-smtp.messagingengine.com (fhigh1-smtp.messagingengine.com [103.168.172.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by php-smtp4.php.net (Postfix) with ESMTPS for ; Sun, 30 Jun 2024 14:53:24 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 9979411400B3 for ; Sun, 30 Jun 2024 10:52:03 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute1.internal (MEProxy); Sun, 30 Jun 2024 10:52:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1719759123; x=1719845523; bh=Kg/oj/vstf P+yWGgXo7dzgPghuhFigRhY11swzggNiw=; b=ud3ubHYqat6ds0fdeb9a1kobv8 DKwaJfmt2uE9CwDnUBMpw0vWS++t+YAWcWIqaYa7zi0bRVOmfnxgskGm/Ktl9fTv uEsWIlOFz5gqKOZh+CFtrMK5BtQ/yDW6/1E3VxY867d+erlgRt/sQnIQw5R0x2GB DZ39+AzCAHQ3R/k3n2mrITMdl1paPdV4kiLunDLCBf6Cd1eTmuCq7pOXiD7mM7Te Xq8SiccscrjPOQEtMi1VRh+jwMcRlKM3T2Xydq2vDxL38sbHPOwCXMCijsIsAdTc 3lEO8hJqefuT+SnqqhAkAGYvuLdXWT7TK76X5D+auLRTU5YFexlepW2hdFDQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1719759123; x=1719845523; bh=Kg/oj/vstfP+yWGgXo7dzgPghuhF igRhY11swzggNiw=; b=VuCeTSvlLHNfvvMPNdbuGyzfiOZD5cWhGpnpgyfvjtvV 7b6OydehNZ79GXSIVLhm3Ip3jj2LALA6JrfOZZuZSmp+b35KCRdvt5rqZFZKtA7s hZoaLsatHAfMCadFafaNJrv6WUdA01tc8CFxJVq5dZ6pxvAI5PFFdHmeRMa5P4Nh /Ty34yU68aPPlIPNxhEavsQ/mqXwd0lgsvC+Ej6FRNXUVYn0qk4ShZUrsSc7X6D8 lmNNcJldMoIbxSUxLeM4GJIlsG2Ap6BkQvqQgH9Bqo4NYngHy0SXyxPsa286Y2aL S/MRlSW2gYym9k+EetHZRfLeQZkS+ThYWG5V74WHjw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddugdekudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkjghffffhvffutgesrgdtre erreerjeenucfhrhhomhepfdftohgsucfnrghnuggvrhhsfdcuoehrohgssegsohhtthhl vggurdgtohguvghsqeenucggtffrrghtthgvrhhnpedufedtgedvhffhkeektedvffdufe ekleffuefgiefffffhieefveelhfetteehtdenucffohhmrghinhepphhhphdrnhgvthen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehrohgsse gsohhtthhlvggurdgtohguvghs X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 316FE15A0092; Sun, 30 Jun 2024 10:52:03 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-538-g1508afaa2-fm-20240616.001-g1508afaa Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: In-Reply-To: <668168A7.4040005@adviesenzo.nl> References: <668168A7.4040005@adviesenzo.nl> Date: Sun, 30 Jun 2024 16:51:42 +0200 To: internals@lists.php.net Subject: Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath Content-Type: multipart/alternative; boundary=c9403716f7c446d092c617a183892a7c From: rob@bottled.codes ("Rob Landers") --c9403716f7c446d092c617a183892a7c Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sun, Jun 30, 2024, at 16:16, Juliette Reinders Folmer wrote: > On 30-6-2024 16:04, Saki Takamachi wrote: >> Hi internals, >>=20 >> I created an RFC and put it in discussion status. >> https://wiki.php.net/rfc/add_bcdivmod_to_bcmath >>=20 >> I expect return values will probably be the main topic of discussion. >>=20 >> Regards, >>=20 >> Saki >>=20 >=20 > Just a suggestion: what about making the returned array an associative= array ? Like so: > ``` > array( > 'quotient' =3D> 61, > 'remainder' =3D> 1, > ); > ``` >=20 > This would remove the need for devs to remember the order of the retur= n values and would make the return value self-documenting. I came here to say the same thing. The best solution would be not having= to refer to documentation or experiment with values, and this hits the = nail on the head. The only thing that makes it weird is having to write it out, which at t= hat point, it is probably faster to type out bcdiv and bcmod separately. Have you considered simply using references passed to the function? I fe= el like that is more idiomatically php. =E2=80=94 Rob --c9403716f7c446d092c617a183892a7c Content-Type: text/html;charset=utf-8 Content-Transfer-Encoding: quoted-printable
On Sun, Jun 30,= 2024, at 16:16, Juliette Reinders Folmer wrote:
On 30= -6-2024 16:04, Saki Takamachi wrote:
Hi internals,

I created an RFC and put it in discussion status.
https://wiki.php.net/rfc/add_bcdivmod_to_bcmath

I expect return values will probably be the main topic of discussion.

Regards,

Saki


    'remainder' =3D> 1,
);
<= div> ```

This would remove the need for d= evs to remember the order of the return values and would make the return value self-documenting.
<= /div>



--c9403716f7c446d092c617a183892a7c--