Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:130997 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 4905D1A00CC for ; Sat, 23 May 2026 18:58:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1779562716; bh=IsAPvRuHf4OlwMSx94CW63UzRJcPvkDrBRDHT/9RheE=; h=Date:From:To:In-Reply-To:References:Subject:From; b=H08yvhEeVi9nU+OiyDCib3h1Gjg6SHcVxBK63lcLclGeMMe3akgTcPysC67logHoL ilZSOzaauHD7dCGABIroAurM4L43h1Hb+WqG4wxAOwkMLy8KaefORd25wXyAWv2HTg 9axUiuVKHSG1lkPVR87gQ7AEjop7At8w6Ha9NqUHvzRVZPQklnud1oakXV+pABMcsF PwPpXYUOqH2287nyITVcnP3DQx9Mqlj8HLvcGlL1p/u9Xia0gCpzRg7F/cz/MSrIw8 r3qcXmpDcgwkeK+PEi9S3wJn3wic2SHnB/HALCX6l2k/UG/85eqKeGXUEPpNP/YsZF RV3gH/Bz292Xg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 8E6891805E9 for ; Sat, 23 May 2026 18:58:33 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=4.0.1 X-Spam-Virus: No X-Envelope-From: Received: from fout-a4-smtp.messagingengine.com (fout-a4-smtp.messagingengine.com [103.168.172.147]) (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 18:58:31 +0000 (UTC) Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id 415C6EC012D for ; Sat, 23 May 2026 14:58:26 -0400 (EDT) Received: from phl-imap-02 ([10.202.2.81]) by phl-compute-04.internal (MEProxy); Sat, 23 May 2026 14:58:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= garfieldtech.com; h=cc:content-transfer-encoding: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=1779562706; x=1779649106; bh=IsAPvRuHf4OlwMSx94CW6 3UzRJcPvkDrBRDHT/9RheE=; b=AhyQpt5A2jAWXH8OUBAVBg5SqIokbbittkhdS 7ivzAwlpTayGVnrBuJlEw5LwqBGFKkqyKRN05/fAZs2jKxJq4p1y689F/vS2u/V7 rrGACijFkUTLmsoIXSEXyW0fbYllabGuDmqaVbFVcjImmW9dVy48rXUv9QEFE8ob TkI2LspLY70k8eNizRyfTcidSD/q6p3/w52todOx83+7FW3phwZ8ADK6J5wqMAsB +rN3ed+l514wHL+s41GTPo9tPzY+8NSw7PqfRC+gic9HuaQ/K2ntqlJ0h3kyS+q1 SJ6tVmner1JftHAPPmNQw0Y2FdfugHNwgDAtzyGBkBlerwzkw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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-sender :x-me-sender:x-sasl-enc; s=fm3; t=1779562706; x=1779649106; bh=I sAPvRuHf4OlwMSx94CW63UzRJcPvkDrBRDHT/9RheE=; b=M1QTJVbnPzU4TFEf/ yy+8WrCQPNyjEtndcijS06gRJluUpbCFwLRFKl5oHyLhLu1qyWbgVqElxMQxjF+P duqH5f+tOdH81Elxdp1dSP7Qh+cgWXdEr9jNCtpnEWq1rVf/JdYS2jTqJjZLxZeL a+ThqeXHJvwTjA/DeKrZXDNvE1HUVv203kHQJGxsJsaNU4aOfVr/qQLwVXkJUWs5 L8e61LpDIX2mX8iQvvGnhGbetfevCHeB9u36IsmBKNqnxFwUYaqIkKGfmE78lKbj Jd6TjhiCismfcT1lj/tYjEUDK9dfLEWXjMeSqxHrloGywb+u44j4jd5RGoWlUrwg hYl8Q== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgdduheefkeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepofggfffhvffkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfnrghrrhih ucfirghrfhhivghlugdfuceolhgrrhhrhiesghgrrhhfihgvlhguthgvtghhrdgtohhmqe enucggtffrrghtthgvrhhnpeehjeefvefgfeduteffffdvheeiudekieefleevvdduiefg keehvdevheffvdegteenucffohhmrghinhepghhithhhuhgsrdgtohhmnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheplhgrrhhrhiesghgrrhhf ihgvlhguthgvtghhrdgtohhmpdhnsggprhgtphhtthhopedupdhmohguvgepshhmthhpoh huthdprhgtphhtthhopehinhhtvghrnhgrlhhssehlihhsthhsrdhphhhprdhnvght X-ME-Proxy: Feedback-ID: i8414410d:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id 0A96A700069; Sat, 23 May 2026 14:58:26 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: list list-help: list-unsubscribe: list-post: List-Id: x-ms-reactions: disallow MIME-Version: 1.0 X-ThreadId: AlnxcQSPpjlB Date: Sat, 23 May 2026 13:58:05 -0500 To: "php internals" Message-ID: <0c4c5c0c-ef1b-4eff-9b86-af2224daceb1@app.fastmail.com> In-Reply-To: References: Subject: Re: [PHP-DEV] Add a static initialization method to `BcMath\Number` Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: larry@garfieldtech.com ("Larry Garfield") On Sat, May 23, 2026, at 7:50 AM, Saki Takamachi wrote: > Hi internals! > > In this issue, a suggestion was made that it would be convenient if=20 > `BcMath\Number` could be initialized in a callable-style form (i.e.=20 > 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=20 > classes such as `DateTime`. > > I am in favor of introducing such a static method. It would probably=20 > look something 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=20 > believe an RFC is necessary. > > I would like to hear everyone=E2=80=99s thoughts on this. > > Regards, > > Saki I'm generally a fan of static factory methods like this, so +1 from me. = It would also allow it to be partialed by the new PFA syntax, too. --Larry Garfield