Re: [RFC] [Discussion] Support object type in BCMath
| From: | Aleksander Machniak | Date: | Tue, 26 Mar 2024 16:31:08 +0000 |
| Subject: | Re: [RFC] [Discussion] Support object type in BCMath | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-122759@lists.php.net to get a copy of this message | ||
On 24.03.2024 14:13, Saki Takamachi wrote:
Hi internals, I want to start the discussion on the PHP RFC: Support object type in BCMath. https://wiki.php.net/rfc/support_object_type_in_bcmathHere's another question. 1. Since we have withScale(), do we need to inherit the $scale argument from the functional API? Can't we derive it from the object the method is being invoked on? So, instead, e.g. public function add(BcNum|string|int $num, ?int $scale = null): BcNum {} public function sqrt(?int $scale = null): BcNum {} I'd suggest: public function add(BcNum|string|int $num): BcNum {} public function sqrt(): BcNum {} but I have no clue about BCMath. -- Aleksander Machniak Kolab Groupware Developer [https://kolab.org] Roundcube Webmail Developer [https://roundcube.net] ---------------------------------------------------- PGP: 19359DC1 # Blog: https://kolabian.wordpress.com