Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:123051 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 D6A9F1A009C for ; Tue, 9 Apr 2024 06:56:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1712645826; bh=URl6/ZB1bKRmEx/+MnBT8q8AzdwqylIsuo1qegpJTAA=; h=Date:From:To:Subject:In-Reply-To:References:From; b=EvoMKIa76QbKa9fFGNA/cUN8SUZCr66mEry+uKzEckrHqeaUaNOeoKQ3NM99cZsC9 KYXrNE8C21da5e/h94bauESf6KK6Ci/VC188X+mLGzQCZGGy0aKQf/vwTj4aohr2IA zwRrmoTK5Vwhf9CHhBeNWJYQR23qPIeJad9gMU267NOPaF1itDGyI+iBC573t5k4K6 xmNqhinzMmXJZ0EH3JZ7indfN+0uHqLT2pjATg728684hZoLzq00Gu4BPHbTAkWRCp MTBupNt7HMoSsWsk4BFOkUpFda6SCmiv1b8A1krnfIPT1BqPhJNL5GU+jYJVTr4Qha C/qBCmibkC6WQ== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 09C9018006F for ; Tue, 9 Apr 2024 06:57:05 +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.0 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_SBL_A autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from fhigh2-smtp.messagingengine.com (fhigh2-smtp.messagingengine.com [103.168.172.153]) (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 ; Tue, 9 Apr 2024 06:57:04 +0000 (UTC) Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 1D53D1140113 for ; Tue, 9 Apr 2024 02:56:32 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute7.internal (MEProxy); Tue, 09 Apr 2024 02:56:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rwec.co.uk; 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=fm2; t=1712645792; x=1712732192; bh=URl6/ZB1bKRmEx/+MnBT8q8AzdwqylIsuo1qegpJTAA=; b= ihKwDuSz6IInf+xJwA37cPtBQLhAvQFc3QNH2GxJudy0yD6/Bl+WZUvrjcoBghzZ ZRuRWCMTUbGCN1hCG3NJuPcdxWGWLejtTVY7KN/70yjxYs6J9/qpHs67CQoxSUvn KyB6rt1UpT2pEEI89pQNN9vQkEWTgwgU2rdxsS7k4/n4jBBeI55VZ6I7Za05HZhq hSZpfd9qSeJ8OrMoPRsTQ/2DFnKe7cBdtLMkeOZ142qCsKD0a8nFB22hzwzAf2IA yjWyDQM+EuayJpPnL2kWJ6ym0wp9A5fqMcQa6Jd09Q0MtN6kL0vEsyNLGld7xsoZ lOUA7gFpSV/2Lfba4I/iCA== 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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712645792; x= 1712732192; bh=URl6/ZB1bKRmEx/+MnBT8q8AzdwqylIsuo1qegpJTAA=; b=d Y2iTUJcfNjrfbIqkmEMxeg2nLVRckbFsPRDSmDrOXas7xb6G40usnA2thUNq5a0Y s7gRQQNWsh3NfXn4QhlF0v/0B4xZoEOmaGKAspH3MSta0rj20gUKXphZJn/vNdeP 99pujvSvDJs1tfJuvJMMYX760PMxWH3uXCGBYUi45BXbBQxZgtPdCC3l9xLHiwk6 kj294BWw3qyrNhnMsiZWp1BXpnCwolkZ16e8gxENLIqYDWaMcSk+ZcXIEsdg++tj LTp1inIhSmtiMvekEyQPCmnMprZFSvM7ezFJKm+JTdVPbASK0k/2q2hxG08v7P+B EwEr7JIU4RWkzwtFNiwBw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudegkedgkeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffhffvufgfjghfkfggtgfgsehtqh hmtddtreejnecuhfhrohhmpedftfhofigrnhcuvfhomhhmihhnshculgfkoffuohfrngdf uceoihhmshhophdrphhhphesrhifvggtrdgtohdruhhkqeenucggtffrrghtthgvrhhnpe efgedthedtleeuheevtdefleefiedvleekleefudfhkefhgefgffdvvedvveeggfenucff ohhmrghinhepphhhphhinhhtvghrnhgrlhhssghoohhkrdgtohhmpdhnphhophhovhdrtg homhdphhgvrghprdhsphgrtggvnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghm pehmrghilhhfrhhomhepihhmshhophdrphhhphesrhifvggtrdgtohdruhhk X-ME-Proxy: Feedback-ID: id5114917:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Tue, 9 Apr 2024 02:56:31 -0400 (EDT) Date: Tue, 09 Apr 2024 07:56:28 +0100 To: internals@lists.php.net Subject: =?US-ASCII?Q?Re=3A_=5BPHP-DEV=5D_Native_decimal_scalar_support_?= =?US-ASCII?Q?and_object_types_in_BcMath_-_do_we_want_both=3F?= User-Agent: K-9 Mail for Android In-Reply-To: References: <40553F28-2EC2-475A-BD8E-1D6517AA2A51@rwec.co.uk> <2B518F62-B774-45C9-82A2-EF6653AAE34E@sakiot.com> <0f3d0f89-3064-4d56-9fb2-801bb0cda8a5@rwec.co.uk> Message-ID: <9FEBB00C-A51A-40D6-A18D-593C78938BCA@rwec.co.uk> Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable From: imsop.php@rwec.co.uk ("Rowan Tommins [IMSoP]") On 8 April 2024 21:51:46 BST, Jordan LeDoux = wrote: >I have mentioned before that my understanding of the deeper aspects of ho= w >zvals work is very lacking compared to some others, so this is very >helpful=2E My own knowledge definitely has gaps and errors, and comes mostly from int= roductions like https://www=2Ephpinternalsbook=2Ecom/ and in this case Niki= ta's blog articles about the changes in 7=2E0: https://www=2Enpopov=2Ecom/2= 015/05/05/Internal-value-representation-in-PHP-7-part-1=2Ehtml > I confess that I do not >understand the technical intricacies of the interned strings and packed >arrays, I just understand that the zval structure for these arbitrary >precision values would probably be non-trivial, and from what I was able = to >research and determine that was in part related to the 64bit zval limit= =2E From=20previous discussions, I gather that the hardest part of implementing = a new zval type is probably not the memory structure itself - that will mos= tly be handled in a few key functions and macros - but the sheer number of = places that do something different with each zval type and will need updati= ng=2E Searching for Z_TYPE_P, which is just one of the macros used for that= purpose, shows over 200 lines to check: https://heap=2Espace/search?projec= t=3Dphp-src&full=3DZ_TYPE_P&defs=3D&refs=3D&path=3D&hist=3D&type=3Dc That's why it's so much easier to wrap a new type in an object, because th= en all of those code paths are considered for you, you just have a fixed se= t of handlers to implement=2E If Ilija's "data classes" proposal progresses= , you'll be able to have copy-on-write for free as well=2E Regards, Rowan Tommins [IMSoP]