Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122957 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 184961A009C for ; Fri, 5 Apr 2024 08:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712306317; bh=vWcisoC+JeVBl+kXNf3PS6/TbuiitI816Wk4hHhNzMg=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=l1SMkpxSCS2CF45CSkJKaWy3Ym74T31O3vam2/4hu+QAxk1jw206pFZ3BoOltcNc1 z93e9paegy07POq4cALtrHUSgsCAavF8e5c1gUGAYApJeIQImVS7Vy9ve6fn8rptK6 Xcz791cH6GiYXOhrC1+ctLQvxdjBdtZ74Ho8gPp2mg3o6uhuj1j/ARzjbeKx4RClub jmmQFN4x2vfFfh67hG+OKHTEoHfKx5EHQKy+6h3zZKah9mcWJ6Yg8npN6g6JMLePQw iIYnmh01HBLgsdHWhINT6O0xU93A4BM+WJk9iqb0OsJSPYs0d+Ks2cVs1zvlNr49Z6 51AvcQNgSA3pw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id F26CA18005D for ; Fri, 5 Apr 2024 08:38:35 +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: 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 ; Fri, 5 Apr 2024 08:38:35 +0000 (UTC) Received: from smtpclient.apple (144.149.159.133.rev.vmobile.jp [133.159.149.144]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by mail.sakiot.com (Postfix) with ESMTPSA id AC6534005A; Fri, 5 Apr 2024 17:38:02 +0900 (JST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sakiot.com; s=default; t=1712306282; bh=vWcisoC+JeVBl+kXNf3PS6/TbuiitI816Wk4hHhNzMg=; h=From:Subject:Date:References:Cc:In-Reply-To:To:From; b=EknJWhhxYbQUOE12kIdq3cKk9CfRWX2E4HuiglJ/YScRHQ3HVYxIjXJpAG3L8dTlg bng0GezdmL0InrH1FsSMI8OursTPOvsjZSd7liiLv9zMIYSoxEqfaW+cKo7ijGSdGz nSwNjm1zed8oH2yD7KfPo5eW+1/KCN2UCH9gJO4k= Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net Mime-Version: 1.0 (1.0) Subject: Re: [PHP-DEV] [RFC] [Discussion] Support object type in BCMath Date: Fri, 5 Apr 2024 17:37:49 +0900 Message-ID: <1F912518-DE28-4E83-B9AA-AC135822B306@sakiot.com> References: <5876c04a-bfed-4a97-be65-f8b64ddef31a@redmagic.org.uk> Cc: Jordan LeDoux , internals@lists.php.net In-Reply-To: <5876c04a-bfed-4a97-be65-f8b64ddef31a@redmagic.org.uk> To: Barney Laurance X-Mailer: iPhone Mail (21D61) From: saki@sakiot.com (Saki Takamachi) Hi Barney, > Ah ok. Maybe that's the standard way internal classes are written, and we c= an consider it generally an error for a child class to override the construc= tor without calling `parent::__construct()`. I know tools warn users not to f= orget the parent call. Thanks, A fallback would be possible to always set the initial value to 0, b= ut an error would probably be easier to understand. > And I had been thinking of BcNum as a readonly class, but I see it's not a= n readonly class, it's a mutable class with its one and only property being r= eadonly. I agree that it seems unnecessary to force child classes to be imm= utable - I wasn't concerned about them adding additional, mutable, propertie= s, only about leaving the value property uninitialized. (Btw I would have su= pported the 1st part of the 2022 Readonly amendments RFC, which I think woul= d have made a readonly class behave the same as a class where every property= is readonly, particularly since would have allowed implementing the example= given on the Wikipedia page for LSP: a circle with fixed centre and mutable= radius may inherit from an immutable point) Ah, sorry about that, I completely forgot about the readonly class! In that c= ase, it might make sense to make the classes completely immutable, since use= rs are already accustomed to using such classes. This is a departure from what I said in my previous email, but how do you th= ink about making it a read-only class? Regards. Saki=