Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:122005 Return-Path: Delivered-To: mailing list internals@lists.php.net Received: (qmail 93585 invoked from network); 15 Dec 2023 01:10:02 -0000 Received: from unknown (HELO php-smtp4.php.net) (45.112.84.5) by pb1.pair.com with SMTP; 15 Dec 2023 01:10:02 -0000 Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id C9178180038 for ; Thu, 14 Dec 2023 17:10:19 -0800 (PST) X-Spam-Checker-Version: SpamAssassin 4.0.0 (2022-12-13) on php-smtp4.php.net X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_PASS,FREEMAIL_FROM, HTML_MESSAGE,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: No X-Envelope-From: Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (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 ; Thu, 14 Dec 2023 17:10:19 -0800 (PST) Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-5c701bd98f3so86448a12.1 for ; Thu, 14 Dec 2023 17:10:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702602600; x=1703207400; darn=lists.php.net; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Uwga6E3x/yoxHP+TbxEjerhsWkvLT9PqlldEWiJ8to8=; b=lPt7Z02VaT9+ZKd88wPw406csjzSjG9EKPWZU0eueo0v2KBE2hWgRQlGABO6Ky6QAX ftWI4ntW8CHNaYo/sHnzwtE6HEnbP1VZQzh05GJDhMpp1uVAZEMrWpv4etrEOEidxxkl WiB2Fq62AJbYYvifbDrWpZGy2xwtNokb8Ct5EwGEY3mtp/7wu5apBiXVaHDDlBd5XKDP xS5Q1ebMlzvWA7EA3npiEIUX7Gtqud+/bhL+P3TXDoJ6bqYTRWmoTw05T1mTBVTDBlij yGVskL2OSNWuwauev2R+U2jXIcallhSt4+VPb5/LDTPGyYaqlRXGnqA5c1s5x5HuX2JX raZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702602600; x=1703207400; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Uwga6E3x/yoxHP+TbxEjerhsWkvLT9PqlldEWiJ8to8=; b=GD+V/7ijuoH1DfUVdySSD3a620VQHEkZ8CvNw8Cvn/bynaIPwn9uDUT3tsWN5YEaIf n3ov78Kw6dIEr58lHdlTp2D90DFg9kpZEsNmK5zPofOv/Pfse7uOx32rIOGxdTYBpc0G RatgoJxbLlDD4EyIpsgNwZTzkWnbDvhIRkWTh63SDxURpfsrSSdLBOFPohvbilBpqX/i Jq2nFIJwAorUYb9Otu5/KxDTkuWAA0pcpWkBlJWZpxzBY8qyrh7DJrFDLRHmNoXpMQXE lAtJnBqmWEcKBOzrEAoZHa6eSSbCDv7YPg7hjgjbNz0s8c267MZOXNautOJY9zp8abOq P9hA== X-Gm-Message-State: AOJu0YypX9NS/dZ0rLJflptiV2Ds8aZu4VDj+O76OSOiMZhYqIsX9fhQ 56+NbruVkkGlxcPx5VFIRjditP8HgmaSfrocX/xxq7+Dm1A= X-Google-Smtp-Source: AGHT+IFeBYXK+22RIlGtKmDCWdGWZ2d1tpTHe+caRA817qgKbNn3/5z0RVLOvwqaX7YyyJJxO/dc4M7hoKrXxoziNIs= X-Received: by 2002:a17:90a:bb01:b0:286:a454:6b44 with SMTP id u1-20020a17090abb0100b00286a4546b44mr5317623pjr.27.1702602599909; Thu, 14 Dec 2023 17:09:59 -0800 (PST) MIME-Version: 1.0 References: <18c42fdbb30.2831.17a3710df6d58f02ca570cc47e197a63@interi.co> In-Reply-To: Date: Fri, 15 Dec 2023 01:09:48 +0000 Message-ID: To: Robert Landers Cc: Alexander Pravdin , internals@lists.php.net Content-Type: multipart/alternative; boundary="0000000000002951ba060c820ff3" Subject: Re: [PHP-DEV] Proposal: Arbitrary precision native scalar type From: george.banyard@gmail.com ("G. P. B.") --0000000000002951ba060c820ff3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, 12 Dec 2023 at 21:00, Robert Landers wrote: > On Tue, Dec 12, 2023 at 2:04=E2=80=AFPM G. P. B. wrote: > > GMP supports operator overloading > > GMP kinda-sorta-most-of-the-time supports operator overloading. > Sometimes ... it doesn't. I implemented a field library in PHP (for > work a couple of years ago) and occasionally, overloading would cast > things back to float/int and break the math. I don't have access to > that code, so I don't have any examples readily available (and the > fact that an extension can do overloading but we can't in user-land is > a whole different can of worms which made this library ridiculously > hard to work with -- we rewrote everything in Scala and never looked > back). Needless to say, if I were to go into a project that required > GMP, I wouldn't trust the overloading. > I have no idea how _this_ is possible considering GMP will happily throw type errors left and right even in cases when it shouldn't. If you encountered this, you should have submitted a bug report. Because, using a potential bug as an excuse for not doing this is... weird? I have come around userland operator overloading with the proposal from Jordan, but considering this hasn't passed it might take a while before someone gives it a crack at it again. And it has _always_ been a thing that the engine, and internal extensions, can do more things than userland. Especially nonsensical stuff like variadic parameters not at the end... Gina P. Banyard --0000000000002951ba060c820ff3--