Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:124080 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 739241A009C for ; Sun, 30 Jun 2024 08:56:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1719737892; bh=qEHH+0f330hZCx8Jomo27LrvD9IZuA0O5sPwA9hFqVo=; h=In-Reply-To:References:Date:From:To:Cc:Subject:From; b=dJor3rybKkPo1+a9w6LkbfCSo9rttrDb+DOX35oSkwh/NpnX0NRfaEeu+oz4TYYPj 19j32k0yovrn33r5a5sHTJIDBIQmCRIW/ObADuUArR2hoabXDpkBET36XMNUP0r3/c VdK0AwLPME/SF6IX0J96UyrSDROcJ/TAs28Z6JOzL9GVcOu7h/5dKl+KKhQHKo5NVF 1NAomh8h050HmZhA1UeaRbzIiMf7x6ZdO1B4OG/t7nihqyFFAW6pcSF4xzm+YPQQvX 9BCHLh7WENHOIIJuAI610SAKdeBwlJWOHPID8x7mW/PSj0MawLVH1jQ3LfqqWSg+r6 JWrpojD5Q7iSw== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 13B901806B9 for ; Sun, 30 Jun 2024 08:58:12 +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.1 required=5.0 tests=BAYES_50,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,DMARC_MISSING,HTML_MESSAGE, RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=4.0.0 X-Spam-Virus: Error (Cannot connect to unix socket '/var/run/clamav/clamd.ctl': connect: Connection refused) X-Envelope-From: Received: from fhigh5-smtp.messagingengine.com (fhigh5-smtp.messagingengine.com [103.168.172.156]) (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 ; Sun, 30 Jun 2024 08:58:11 +0000 (UTC) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 186831140240; Sun, 30 Jun 2024 04:56:51 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute1.internal (MEProxy); Sun, 30 Jun 2024 04:56:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bottled.codes; h=cc:cc: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=fm3; t=1719737811; x= 1719824211; bh=qEHH+0f330hZCx8Jomo27LrvD9IZuA0O5sPwA9hFqVo=; b=g Q8NE2JCnbvjEJpmZBgeY28NB2J3D61Rkh8vkocZj5bjFzSodWapk94AMRfchrogy ALcmCTAfY98qUF/dRf26Uc7GicMMazNITGLTh85TcwJ9Br2KjZ129hfYdqtD91iK lghfgC3y5tuRLytoPgSoYKkza4oSPLJKNwjtkv2pccPnnoblNyALRqUnsj4h0zgj +pNlhs+47c9DEiN5r9HROu13LBDF/rYOyi0KNFa7Lfh+ETK52fUwE/vPQ9zwjDxk T9o2dCTdzmqm+LkPhuNW5W6tRNmEC3evTdASc58YXCwYHmx6IVJfUNGqjr5W9kGt 6KpfdYqxQSJhgdvvvjHcw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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=1719737811; x=1719824211; bh=qEHH+0f330hZCx8Jomo27LrvD9IZ uA0O5sPwA9hFqVo=; b=RETQeqJw1ra08TRMmM5zY2P13xzPv+BBAMh+pBzxm9nt CTgdzo63y+sEuGRU6qQ8j6PiA1Vo1xa76MD389fpWgaKMcUohkEKeaEU9KaBwzLz OZcayauRPYHZEU4qAVaCri3Wf5WIcyxafccHIUDsSYT+4OzoFPlrVHNOmesRlNt2 a8FpA/JRjdwN/2Q3y58y0Co4/cLlA/Dj2I9YrvMnrFXxRIsf1M15b63nOQ4Ms3VJ FZ3Fd3aNavB22UNnzEEWl6c/3fe589MUTLTan76Vn/p8nzhOfiHYNZXiY/X+vMgT JsKtNsDry4AwCgdsrm8+IADp5DjZxAa7z7hfcwCXrQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddruddugddtkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesrgdtreerreerjeenucfhrhhomhepfdftohgs ucfnrghnuggvrhhsfdcuoehrohgssegsohhtthhlvggurdgtohguvghsqeenucggtffrrg htthgvrhhnpedvheekteelveetfeevgeekgfffvdeuhfelveehvdetiefggedtfeejheet gffhueenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hrohgssegsohhtthhlvggurdgtohguvghs X-ME-Proxy: Feedback-ID: ifab94697:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 46CD715A0092; Sun, 30 Jun 2024 04:56:50 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-538-g1508afaa2-fm-20240616.001-g1508afaa Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net MIME-Version: 1.0 Message-ID: <466994ae-64b0-4c73-a841-31de082ed247@app.fastmail.com> In-Reply-To: <1E19168D-BA9F-488E-825D-C2D94666450B@sakiot.com> References: <2e7f87d2-a2a1-47f4-a1f0-31cf490a2edf@app.fastmail.com> <1E19168D-BA9F-488E-825D-C2D94666450B@sakiot.com> Date: Sun, 30 Jun 2024 10:56:30 +0200 To: "Saki Takamachi" Cc: "Gina P. Banyard" , internals@lists.php.net Subject: Re: [PHP-DEV] [RFC] Operator Overrides -- Lite Edition Content-Type: multipart/alternative; boundary=11532cf72bf64262ba1f722cf23783f5 From: rob@bottled.codes ("Rob Landers") --11532cf72bf64262ba1f722cf23783f5 Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable On Sun, Jun 30, 2024, at 09:31, Saki Takamachi wrote: > Hi, >=20 > >> It seems like the "hack" I mentioned is still possible, am I misund= erstanding something? > >=20 > > That=E2=80=99s always going to be a possibility, no matter what we d= o or how we do it. I think it would be a rather pointless hack now that = I can run the code. For the most part, the engine treats these as number= s and trying to dodge that will land you in hot water eventually.=20 >=20 > I'm not sure. Does this mean that such "hack" is unavoidable? >=20 > And I don't really understand what "pointless hack" means. This would = make sense if operator overloading was already allowed, but it isn't. Not unavoidable, but pointless. For example, I attempted to create a Str= ing class that used + for concatenation. This kinda works, but if you pa= ss it to something that takes a string, you get the underlying number an= d not the string you were trying to store. This is because GMP takes ove= r casting forcing you to stick to numerical constructs. >=20 > >> And I don't understand the purpose of polyfills at all. If you're n= ot using the GMP extensions and can't do operator overloading, won't you= just have a class with protected methods that are never used and don't = actually do anything? > >=20 > > Ah, that could probably be clearer in the RFC, but you have to make = it public to be able to use it. > >=20 > > It=E2=80=99s a bit clunky to use without the extension, but that=E2=80= =99s mostly because I didn=E2=80=99t want to get into OperandPosition fr= om Jordan=E2=80=99s RFC. Many people were confused about it, so I=E2=80=99= m just avoiding it. >=20 > This is very confusing me. Why does this need to be a child class of G= MP? This is addressed in the current RFC text, if I missed something, please= ask! =E2=80=94 Rob --11532cf72bf64262ba1f722cf23783f5 Content-Type: text/html;charset=utf-8 Content-Transfer-Encoding: quoted-printable

=
On Sun, Jun 30, 2024, at 09:31, Saki Takamachi wrote:
=
Hi,
<= div>
>> It seems like the "hack" I mentioned is stil= l possible, am I misunderstanding something?
> That=E2=80=99s always going to be a possibility, no mat= ter what we do or how we do it. I think it would be a rather pointless h= ack now that I can run the code. For the most part, the engine treats th= ese as numbers and trying to dodge that will land you in hot water event= ually. 

I'm not sure. Does this mean t= hat such "hack" is unavoidable?

And I don't= really understand what "pointless hack" means. This would make sense if= operator overloading was already allowed, but it isn't.

Not unavoidable, but pointless. For example, = I attempted to create a String class that used + for concatenation. This= kinda works, but if you pass it to something that takes a string, you g= et the underlying number and not the string you were trying to store. Th= is is because GMP takes over casting forcing you to stick to numerical c= onstructs.


>> And I don't understand the purpose of= polyfills at all. If you're not using the GMP extensions and can't do o= perator overloading, won't you just have a class with protected methods = that are never used and don't actually do anything?
>&n= bsp;
> Ah, that could probably be clearer in the RFC, b= ut you have to make it public to be able to use it.
>&n= bsp;
> It=E2=80=99s a bit clunky to use without the ext= ension, but that=E2=80=99s mostly because I didn=E2=80=99t want to get i= nto OperandPosition from Jordan=E2=80=99s RFC. Many people were confused= about it, so I=E2=80=99m just avoiding it.

This is very confusing me. Why does this need to be a child class of GM= P?

This is addressed in the cu= rrent RFC text, if I missed something, please ask!

=E2=80=94 Rob
--11532cf72bf64262ba1f722cf23783f5--