A PHP internals discussion about adding a static factory method (`createFrom`) to `BcMath\Number` to enable callable-style initialization. The proposal is motivated by the desire to use the class with first-class callables (FCCs) and partial function application (PFA) syntax. Supporters like Larry Garfield and Marco Pivetta favor static factory methods as an established pattern, though Pivetta suggests a more descriptive name like `::fromValueAndScale()`. Opponents, including Gina P. Banyard and Tim Düsterhus, argue the better solution is to make FCCs/PFAs work directly on constructors and `new` expressions, avoiding the need to add static factories to every class. Banyard mentions an active PR to clean up constructor semantics that could enable this.

4m read timeFrom externals.io
Post cover image