Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124119 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 E034F1A009C for ; Sun, 30 Jun 2024 23:43:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719791085; bh=MyV5w35viKEehVwWvKnTlCZu2wTUY14cz+SUfr+v//k=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=dreK5XLS6aUDsIGF863VJR16c6mUgtOx7j32vlzZ84NOKawnATVof+FtBKQLpcE1h iuyF+lX5Eqtm5LnNy1cKNcU6KSFnqbknbq7GTee75UEYKHX4zhszh7QXGp1xIq4UFi gsMjvoN+4BV4c32jEC4v0/+1IaAxm6Veey7eH/Xj/w9G1T9cKUNLzSRtIfvHViRucG 9Y9KoL45joIs1J2VAPrMeYgpNEai3BmAxEsxixqx/+KSpT8iztiIC1EGqwT0cPsRXj lfZNrTMxDRNQsaWtjqMBzNspC3GGr/P+PjadwWUoq16QK4ZAKdUP8b1o/TIiLpN/Tn z+4B4MJwfEDIQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 62A61180A5F for ; Sun, 30 Jun 2024 23:44:44 +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.6 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,SPF_HELO_NONE, 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 mail.sakiot.com (mail.sakiot.com [160.16.227.216]) (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 23:44:43 +0000 (UTC) Received: from smtpclient.apple (unknown [117.55.37.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id 321994011B; Mon, 1 Jul 2024 08:43:21 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1719791001; bh=MyV5w35viKEehVwWvKnTlCZu2wTUY14cz+SUfr+v//k=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=kd2wd8I3/DgDR40NaHqEN2bfcy5noAdtqbf1VmBRu6TDQbx8CL3+sF8Pkfy6IHtLe eq4C15hjd05Q5L8flO/GHMbRVppnRz208kBMkutHnA6Rqn9c3Dg2OkWcdqObJi63AI XoU3LpBGFs4DiZypb4klHqJkY1HTztS7P3rg0WX0= Content-Type: text/plain; charset=us-ascii Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.600.62\)) Subject: Re: [PHP-DEV] [RFC] [Discussion] Add bcdivmod to BCMath In-Reply-To: <7f1ba41b-ace8-4af2-8efc-1412c47e34cb@app.fastmail.com> Date: Mon, 1 Jul 2024 08:43:08 +0900 Cc: php internals Content-Transfer-Encoding: quoted-printable Message-ID: <8BB31FFD-F44D-4259-A0AB-398B08770F74@sakiot.com> References: <668168A7.4040005@adviesenzo.nl> <3B23E039-D90F-4F84-9ECE-C6A9A3E145AF@sakiot.com> <7f1ba41b-ace8-4af2-8efc-1412c47e34cb@app.fastmail.com> To: Larry Garfield X-Mailer: Apple Mail (2.3774.600.62) From: saki@sakiot.com (Saki Takamachi) Hi Larry, > I agree an associative array is the second-worst option. An inout = by-ref argument is the absolute worst. >=20 > Normally my default position is that when in doubt, make it a = structured object with properly defined properties, and screw whatever = micro-performance hit it is, you won't notice. 99% of the time I = believe that is the correct approach. >=20 > I can see the argument that this is the other 1%, since it's just two = values, which will basically always be wanted separately but both wanted = (meaning divmod(...)->divsor is kinda pointless), and their order should = be fairly self-evident. >=20 > However, in that case I would urge that both the RFC and the resulting = documentation *always* use examples that return into a `[$foo, $bar]` = destructured list. Don't even suggest that people should use 0 and 1 = indexes. It's a tuple for deconstruction, that's it, if you're using it = some other way you're probably wrong. Politely ignore that it's even = possible, lest we lead people down the dark path. >=20 > (Which means removing the current index-using example and just keeping = the pizza example.) >=20 > --Larry Garfield =20 Thanks, agree. I rewrote the non-pizza example. Regards, Saki=