Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:125570 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 71EF51A00BD for ; Mon, 16 Sep 2024 17:58:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=php.net; s=mail; t=1726509623; bh=LDp/6UNdbcs7D/SoyZQH4J2vqwufD/6BpwcF+fL90Ys=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=GxhhuWTniWhDWWA6HQcka2lIIasJpIWq5n5vKfnt7fEUtiXCG7F3H31X1QH28I9tO Ut8jyvlQTPtbO2rUvoaVcBuoTX3rxs/VqWCLxFyjzkxPLQIL0F1SQDs0OqC7N9UEGH yv/NZlrTCxx2BhrSyrxefpZLyKT3PFOJOkBKik2010w46i10x3fscBXKNwlPZH8Ue7 jvR7WV4vtMU2DAcviFVL4s4nDp9e52g6oSqgds+LLqSu2DDqOuc83Vbt6CbezJzg1o Mthu9rwAvrzfYi5aiCFMVHzg8m8hLjwZPQnzj52DIy9alBggBQWmHwzE9eemq4tV44 5u7HHNvhUYwlg== Received: from php-smtp4.php.net (localhost [127.0.0.1]) by php-smtp4.php.net (Postfix) with ESMTP id 36F76180052 for ; Mon, 16 Sep 2024 18:00:23 +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,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-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.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 ; Mon, 16 Sep 2024 18:00:22 +0000 (UTC) Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-205722ba00cso39805305ad.0 for ; Mon, 16 Sep 2024 10:58:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726509497; x=1727114297; 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=LDp/6UNdbcs7D/SoyZQH4J2vqwufD/6BpwcF+fL90Ys=; b=EZsGWl+vVtxzl8386Am3MHI5gS5fu7TfaXCEBa8g/WgQIq6V0pLJIqXBva/oA5so4A B7KcAcWFFpiyOsYjYrd0+IfTGH8SCKTVShlSjtYzOHgMVsPXs8GlbSMEGei+z7PYAYSV TWRGaiywXQsXaeEowIQkDr9dOY73WCnt1jpQikO/q7IL9CaGPfv+CAzyExWj/CV1Cl49 b6bne98t/4hrHIxjvcY5Fd4/ptJt+GLo0SLYS3w4VI3zXBIYzZ0WYbiYBFa5BvrPZeoN oD3e7v5p8loMRlCwwGcmF61tNQwRWuHUhGSAPF7IWLlfhvTCqIlMq1WwWVKg8f70FBS5 IuAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726509497; x=1727114297; 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=LDp/6UNdbcs7D/SoyZQH4J2vqwufD/6BpwcF+fL90Ys=; b=BXmchq5pZHoQHVEauF9ZViZcKpZhqrDECauLMd8/i5j7dh1YdCwf/aScaHLs6qVcjc 80MFXn+XSdvVGrZi05WKKCneFIuTXVJLJouSEXRzfUwiac3TDr14hqnelRUeid5PQ45T kDbPloMbpp25cb32w02ZdhRYc0SKqpMzJN/WIw3xcEe1Y6vI5hmNs1+96CMeV5S3hrmX IlR/NrHrfJ/csmIEXmI4YyUjGK3VeE7dcHoNNa8qJmeOOUI0K4xpV5KgU2a1bld0kgLe 7lZAYxaq3KiJKI0WL0/nZ15qXQhfeWQZ6ua9OWGYUi0gipU5CqIn5bPQ4BonSGjRUB96 v6oA== X-Forwarded-Encrypted: i=1; AJvYcCU5SskMDxdxIvn5Ow214hUUUzGEtUaPhwuQO89hTVUw4EGafNToVaPupYZqJ49R6ZS65bUTJoleuWM=@lists.php.net X-Gm-Message-State: AOJu0Yxath+lwTKeiC2oJ19XagOY/z1XnaAxdrkE2slLKs2itFMNokpA ImZi49NHCS7oNfuuQrp0iM6ptcodRHYiLIRI/S0UQWYEc1MDAqUcWGIjQx//5AE48zREe2Chu3s lTy4xtW+UiWEMN5nr8pJaoXDWKWIeeQ== X-Google-Smtp-Source: AGHT+IFg1e3Me4tcGBsWMQLt1edp6iyt9hI168MPFTmaR3pz1L7bHwy5v2bXQqkyCv8uwLgGTQSwAu7Dah+MWiXBz+E= X-Received: by 2002:a17:90b:1e02:b0:2d3:d09a:630e with SMTP id 98e67ed59e1d1-2db9ffb0e41mr19470654a91.1.1726509497265; Mon, 16 Sep 2024 10:58:17 -0700 (PDT) Precedence: bulk list-help: list-post: List-Id: internals.lists.php.net x-ms-reactions: disallow MIME-Version: 1.0 References: <4b8c42eb-e1b0-4c20-84bf-1e6faf4659ce@app.fastmail.com> In-Reply-To: <4b8c42eb-e1b0-4c20-84bf-1e6faf4659ce@app.fastmail.com> Date: Mon, 16 Sep 2024 10:58:05 -0700 Message-ID: Subject: Re: [PHP-DEV] [Pre-RFC Discussion] User Defined Operator Overloads (again) To: Rob Landers Cc: Larry Garfield , php internals Content-Type: multipart/alternative; boundary="000000000000493c3f0622405110" From: jordan.ledoux@gmail.com (Jordan LeDoux) --000000000000493c3f0622405110 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, Sep 16, 2024 at 6:08=E2=80=AFAM Rob Landers wro= te: > On Mon, Sep 16, 2024, at 09:47, Jordan LeDoux wrote: > > The reason for this was to prevent developers from creating situations > where `5 > $foo` is true and `5 < $foo` is true. > > > Just to point out: currently, PHP already does nonsensical comparisons: > > https://3v4l.org/BZfc8 > > Granted, it is 'technically' correct that ($a <=3D $b || $b <=3D $a) =3D= =3D=3D > false; but this really should be an error IMHO instead of a non-logical > result. > > =E2=80=94 Rob > Yes, the default comparisons for objects is a little strange. This should be helped by Gina's RFC which I mentioned in my original email. The main issue is that at the moment Equatable and Orderable are inseparable within the PHP engine. Jordan --000000000000493c3f0622405110 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


=
On Mon, Sep 16, 2024 at 6:08=E2=80=AF= AM Rob Landers <rob@bottled.codes> wrote:
<= /u>
On Mon, Sep 16, 2024, at 09:47, Jordan LeDoux wrote:
=
<= div>
The reason for this was to prevent developers from creating situat= ions where `5 > $foo` is true and `5 < $foo` is true.

Just to point out: currently, PHP a= lready does nonsensical comparisons:


Granted, it is 'technically' correct tha= t ($a <=3D $b || $b <=3D $a) =3D=3D=3D false; but this really should = be an error IMHO instead of a non-logical result.

=E2=80=94 Rob

Yes, the default comparisons for objects = is a little strange. This should be helped by Gina's RFC which I mentio= ned in my original email. The main issue is that at the moment Equatable an= d Orderable are inseparable within the PHP engine.

Jordan
--000000000000493c3f0622405110--