Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:102403 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 30672 invoked from network); 24 Jun 2018 20:56:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Jun 2018 20:56:40 -0000 Authentication-Results: pb1.pair.com header.from=rowan.collins@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rowan.collins@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.128.180 as permitted sender) X-PHP-List-Original-Sender: rowan.collins@gmail.com X-Host-Fingerprint: 209.85.128.180 mail-wr0-f180.google.com Received: from [209.85.128.180] ([209.85.128.180:35008] helo=mail-wr0-f180.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 71/3E-13077-485003B5 for ; Sun, 24 Jun 2018 16:56:40 -0400 Received: by mail-wr0-f180.google.com with SMTP id c13-v6so1608883wrq.2 for ; Sun, 24 Jun 2018 13:56:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding:content-language; bh=wIHK7gKdoburQdMSG4nYUkpUEMg51eHaiVYtzAcW8nM=; b=kZkXNY9vaFGQqL6HrrN2AHmUcRpJF+hK/eRON2FcBoxBodUUD+zU4Mz5drGn1tUULB uqbjTq4quig0W6dqScXqo4PHkis+mrnSq/AFFO3w5nrwE9lts5eINxQSxVFLt5R0QeRS C1dFfQhXJSnbvaBlBDnI6UoN6BsAi4wKNI0nwZ96exk9CVg2YSf2vfgleVT/3u1g31EF 9GilkrHDxXZLHW/saTWgVXAnPcLQON+zhCYRE8ha6eGejoQ36Pt/gA/2Npoj/cwz3uCa URg8lOrB4/62Suk0W4mXOsp2g0nem5mTgO01dHgSR7qNZz+rcgWANXpbCkcp8sgaqsAK zmRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=wIHK7gKdoburQdMSG4nYUkpUEMg51eHaiVYtzAcW8nM=; b=sPgFSvouY7eD01Cc/H9bGmRjCTsMgkT4cdLg7XjauoT3DihXHaVDqOIAFqTy/0vZom umtCfZcJIew/8El0pdzFJ+KDgdUAMi2S2KPMTWG8/luRQvnbPqDtQLHMcbaUsYezuypA vgz6mX6bYYj7Ye60H4uJCPA9Hv3QSGowOwmeKx1zZ5c6Mn8gp+NUQUVgKvSkHt28Tr+0 jqn/bPCKYiw/USZXN2fJGYGXoPo8i5ljXqudTcX+ky3ERERD57FTFaSGapWR8SuVFciQ WAagLtxezdD2G+JrJDVtAnQ9JuQJbkPGNCIPA5TcnvLn9+OBu81dd8zKnld6ZCPdsHUS UEhg== X-Gm-Message-State: APt69E2OqsbV53xW+UCurmw3z+f8D1yX9D+6nhi4TX3y1vqnFueTMpb6 qmqBWsqEEBWhaJz1xvC+/YyqJcWg X-Google-Smtp-Source: AAOMgpd2YHnYz8xLxHt2Z8cpUobSUiqgsZbA4R3a3aQeovNp4cqhZ0YE4hBmL2uPnEdk12VUAFs9Ww== X-Received: by 2002:adf:8701:: with SMTP id a1-v6mr8477917wra.178.1529873793735; Sun, 24 Jun 2018 13:56:33 -0700 (PDT) Received: from ?IPv6:2a00:23c4:4b86:4b00:4a6:b2b5:ed7b:8720? ([2a00:23c4:4b86:4b00:4a6:b2b5:ed7b:8720]) by smtp.googlemail.com with ESMTPSA id k82-v6sm14541202wmg.10.2018.06.24.13.56.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 24 Jun 2018 13:56:32 -0700 (PDT) To: internals@lists.php.net References: Message-ID: <914c2c94-6467-fadb-9d44-fb8f5c60e12c@gmail.com> Date: Sun, 24 Jun 2018 21:56:32 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [PHP-DEV] Equality and relative ordering of objects From: rowan.collins@gmail.com (Rowan Collins) On 24/06/2018 21:31, Rudi Theunissen wrote: > So with that in mind, maybe it's okay to take "NULL falls back to default > behaviour" idea out, and do a normalisation > on whatever the user returns. If it's NULL, then that'll be 0, and the > value will be equal. The only thing I don't like about > that is that the user didn't specify "equal" with a 0, they returned the > absence of a direction, and we should therefore > either throw an exception internally, or fall back to the current > comparison behaviour (comparing properties). Since this is a method, and not just a callback passed somewhere, could we simply mandate that the signature has an "int" return type? That way, if the class is written with strict_types=1, it will throw a TypeError for null, and the user will have a big hint that that's going to happen when they write ": int". Regards, -- Rowan Collins [IMSoP]