Newsgroups: php.internals
Path: news.php.net
Xref: news.php.net php.internals:102519
Return-Path: <larry@garfieldtech.com>
Mailing-List: contact internals-help@lists.php.net; run by ezmlm
Delivered-To: mailing list internals@lists.php.net
Received: (qmail 9826 invoked from network); 28 Jun 2018 21:12:48 -0000
Received: from unknown (HELO lists.php.net) (127.0.0.1)
  by localhost with SMTP; 28 Jun 2018 21:12:48 -0000
Authentication-Results: pb1.pair.com smtp.mail=larry@garfieldtech.com; spf=permerror; sender-id=unknown
Authentication-Results: pb1.pair.com header.from=larry@garfieldtech.com; sender-id=unknown
Received-SPF: error (pb1.pair.com: domain garfieldtech.com from 66.111.4.25 cause and error)
X-PHP-List-Original-Sender: larry@garfieldtech.com
X-Host-Fingerprint: 66.111.4.25 out1-smtp.messagingengine.com  
Received: from [66.111.4.25] ([66.111.4.25:55089] helo=out1-smtp.messagingengine.com)
	by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP
	id 1D/3D-01794-D4F453B5 for <internals@lists.php.net>; Thu, 28 Jun 2018 17:12:45 -0400
Received: from compute7.internal (compute7.nyi.internal [10.202.2.47])
	by mailout.nyi.internal (Postfix) with ESMTP id 800CB21ADD
	for <internals@lists.php.net>; Thu, 28 Jun 2018 17:12:42 -0400 (EDT)
Received: from mailfrontend2 ([10.202.2.163])
  by compute7.internal (MEProxy); Thu, 28 Jun 2018 17:12:42 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
	messagingengine.com; h=content-type:date:from:in-reply-to
	:message-id:mime-version:references:subject:to:x-me-sender
	:x-me-sender:x-sasl-enc; s=fm3; bh=n7AXwtC2b/DPALvxmfaPtWbaDmvzw
	S/N9xfmIxQyAaA=; b=YsljUS0E249DqnqK7WtrKk1fK2qE4M4rbwAh8Y7CK0dQD
	HuUR1gR7LmRRte2kSYAUmMufBFEYedP4wcGL7SIAzkvKsbWnQJ5XeNww7wh8Q0/x
	/l5n70C3mOFOrSsYPF+2I7eyfk4hiQdDTv6QcuH4IYC7SOPScNcaPIAuJ2V0npc+
	jNd5k3HEi44DH/LXuIajXRy2B3teVPtwxGPBLtqn7GQJ6YV32Rw0yq8/J1HDbtq5
	VP6xc1JNTptp6sldLaDtt5Pnq94bPWYdX81WwkHxTHvsJQGtVBqqtQvSR2n4AgjV
	+AMX28PVsGWihoU81lmU03KLys8IYsApNCurMvcmw==
X-ME-Proxy: <xmx:Sk81W1NVx-WgS0la0a6BXkDSEREq2biiFjC5uj6nDE0MylTCH7K0Lw>
    <xmx:Sk81Wz_kw2_WcGuWcKxrBSy7ntZLtrvoGI4WdcEsdyppmsiGvVwQ0Q>
    <xmx:Sk81W2cZUCTEEETW_lZd3F8nZZuJW8yYjujVEwVUikEEHXYZVwfqrQ>
    <xmx:Sk81Wyw7lVwI4GinBMljWCAn2-yE3Ai2mpsLIF8i1HclnYormKnEeQ>
    <xmx:Sk81W7KOYbo-g0xZjZ7hJPC4AuvI34UAz2wlm4-s3w3UnCB2_BA6qg>
    <xmx:Sk81W0L-X824vNDusyt3SUjGcuChcofQTH5YJs82WLjT_aghTOr4-w>
X-ME-Sender: <xms:Sk81W3SYYFE-pzZoMW3_2mETgPm0PxaotUXaol8VpQ2OhVp7rCErew>
Received: from vulcan.localnet (216-80-30-152.s3222.c3-0.frg-cbr1.chi-frg.il.cable.rcncustomer.com [216.80.30.152])
	by mail.messagingengine.com (Postfix) with ESMTPA id 00EA210260
	for <internals@lists.php.net>; Thu, 28 Jun 2018 17:12:41 -0400 (EDT)
To: internals@lists.php.net
Date: Thu, 28 Jun 2018 16:12:41 -0500
Message-ID: <1662423.y1zp7GJX4B@vulcan>
In-Reply-To: <CAHFNTwevL1aW498JpOhyeVPFq9Jhynnmmk5-Rpxebxo9zD8oMQ@mail.gmail.com>
References: <CAHFNTweakKC+=+UJCWfD0ONcsrVH7rEKrOhnWObeGD+7TBQLjQ@mail.gmail.com> <CAHFNTwcQf+7B2Jb7ZjBFx625PN4ouRmf5+DjMWOWGB0KKzyRRg@mail.gmail.com> <CAHFNTwevL1aW498JpOhyeVPFq9Jhynnmmk5-Rpxebxo9zD8oMQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart1625463.McxDEkl6s1"; micalg="pgp-sha512"; protocol="application/pgp-signature"
Subject: Re: [PHP-DEV] [RFC] User-defined object comparison
From: larry@garfieldtech.com (Larry Garfield)

--nextPart1625463.McxDEkl6s1
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="us-ascii"

On Wednesday, June 27, 2018 5:58:29 PM CDT Rudolf Theunissen wrote:
> Hi everyone,
> 
> I've made some changes to the RFC and the implementation today to explain
> some of the edge cases and combined behaviour better.
> 
> There are some issues towards the bottom of the RFC that I would really
> like some opinions on. They all have decisions made but are not concrete,
> so I'd like to know if anyone has strong opinions on them before they are
> considered a final part of the RFC. I'm happy with the current state but
> I'm very open to changing those decisions if there's a good enough reason
> to.
> 
> See https://wiki.php.net/rfc/object-comparison#open_issues
> 
> Thank you

Overall, I like.

Regarding what is legal to compare to, it seems useful to leverage the 
optional type hint.  So given:

class Foo {
    public function __compareTo(Foo $other) {}
}

class Bar extends Foo {
  public function __compareTo(Bar $other) {}
}

In this case, the order of checking to see what method to call will also check 
for type compatibility.  That is, $f < $b checks Foo::__compareTo(), finds it 
doesn't match, and so calls Bar::__compareTo() instead, which does.

"However, because magic methods aren't inherited" - Wait, they're not?  Are 
you certain of that?  Because 3v4l.org says they are:

https://3v4l.org/P6Hlq

I don't understand Future Scope point 1.  It... means we're already covering 
those operators.  Why is there future scope needed?

I otherwise agree with the current Open Issues directions.

--Larry Garfield
--nextPart1625463.McxDEkl6s1
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iQEzBAABCgAdFiEE/ph/GXfY8v0YwFBp4MMKwDFxYXcFAls1T0kACgkQ4MMKwDFx
YXehVAgAvDJFJd+4K59/3svtZtvPnze0DjFRLLhPAVM18wFXjNVq0BtHUSBURQMB
oPkhpkT/Ky4V8JmzZ5UJfuK1oC1La0g+IK7Sb8gDN39OUdbAD6y4BqFzTTw9u6Gy
vMIF6Aznj9fnuseXnH2BigGYKFvRdsIipBwfAQfHmYDK4KKaRNKMnWvlFMvT9li9
uQpSAgblzaqajj5i/4SCt+rgUnjPEviwJ7HMbuLJg88djFpEkgMTFusZJL8OCu5p
KhlhJs1MVXUB6CHJLEozALuIJ02rF4Ca6WkBHqQa6YgOk3pnaav/wEWt/bVJ6KFD
Fe3pKms30/LLcb7t5+rkeFCyYVskTw==
=jB/P
-----END PGP SIGNATURE-----

--nextPart1625463.McxDEkl6s1--