Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130989 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 lists.php.net (Postfix) with ESMTPS id 7066C1A00BC for ; Sat, 23 May 2026 12:50:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1779540648; bh=TDMAieikGviVKwx7cOXobwmnd+zVV0ok/bZOVEOLLgs=; h=From:Date:Subject:To:From; b=krTAqkv7pR4dN/LHv8N2l+7j6t4uldqpbYxl7mnLiWX4juRM5dCEHNn2ATZq9tK15 mFY1WN9cnaB+yjb6uQrpdfehUmZVLv0+rnlrZV3Wk2sCJdOBD2KDqxDF2fn2VR2S2w mMfAsAnz4d1aKcOFQaMalxaWJzbc41iepF27Zp14p78d0vZ0X2/stvvtAzFtNxfS/I s4WSi7pDYyjyXrTik9j1yxVI0l/P8BVsnJJn6bOZ8NyW9MqEdAEnjLp9fbVYJHk7bl ALK2TlP/pp4SGXb4Sp7RK06aHD5ZJKqzSfx7/Cxwezv/JY6J2y0Clz5Vx3XWVaw6zc hNXP/ar5rQDTQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 7842518002E for ; Sat, 23 May 2026 12:50:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) 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 autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No 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 ; Sat, 23 May 2026 12:50:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1779540627; bh=TDMAieikGviVKwx7cOXobwmnd+zVV0ok/bZOVEOLLgs=; h=From:Date:Subject:To:From; b=YnKWUqcKjBE9rkF1Z99RfLJCzMKVHxd9mgzwyz0wJ55uad0Nv0M97XoYQ6ODgBb37 YnRjDAcEa6t8gba6ToNbvmjeUeRcaDOfAl7eEGiJr25vR+XzQKEo0vn249tDE7fphY tMNwipqO8ugcFMAwOCDhuUHtMqUUCni0QIkMdhdU= Received: from smtpclient.apple (madb688d19.ap.nuro.jp [219.104.141.25]) (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 mail.sakiot.com (Postfix) with ESMTPSA id D9101401CC for ; Sat, 23 May 2026 21:50:27 +0900 (JST) Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow Mime-Version: 1.0 (1.0) Date: Sat, 23 May 2026 21:50:15 +0900 Subject: [PHP-DEV] Add a static initialization method to `BcMath\Number` Message-ID: To: php internals X-Mailer: iPhone Mail (23D8133) From: saki@sakiot.com (Saki Takamachi) Hi internals! In this issue, a suggestion was made that it would be convenient if `BcMath\= Number` could be initialized in a callable-style form (i.e. initialized via a= static method): https://github.com/php/php-src/issues/22128 Indeed, as pointed out in the issue, similar static methods exist in classes= such as `DateTime`. I am in favor of introducing such a static method. It would probably look so= mething like this: ``` // $scale is optional $num =3D BcMath\Number::createFrom($val, $scale); ``` It would effectively serve as an alias for the constructor. Incidentally, since this does not introduce any BC break, I do not believe a= n RFC is necessary. I would like to hear everyone=E2=80=99s thoughts on this. Regards, Saki=