Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83246 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 41141 invoked from network); 19 Feb 2015 22:35:09 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Feb 2015 22:35:09 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.178 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.214.178 mail-ob0-f178.google.com Received: from [209.85.214.178] ([209.85.214.178:36687] helo=mail-ob0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 1B/F4-10294-C1566E45 for ; Thu, 19 Feb 2015 17:35:09 -0500 Received: by mail-ob0-f178.google.com with SMTP id uz6so20262301obc.9 for ; Thu, 19 Feb 2015 14:35:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=H+AfrtZtbMk94v01YL6SlvaT5OehxWnf6RgynKx28b8=; b=XaSbSfHb8MfkY3IxKKVIYj8G4EW2b0Zq+5JzyDdIxJ5fFd0G4szIbDlUN1kq02Wfi3 X9d2YPIjW44XugTEkrswOaba7JEYGHtXcVZJzfdrD7AjsOlCTUAj9tmi+RjHGV+mXG0U 7nEgz5hQxwpqdvdQ09CyEr3d47RKfe9uWGNZwRf+WwEo0qSJL/KahpOMA80PxT0EIRoA qiT9PzqS2ZqpvKgiADwfbO6fN3M+HAXv3/AkNttnXCF9gYpeiDDq3wVKk86ZNR9b80UU QGKsaEJ8IwG+GeRQsKTlejqkEY83llfXOcRV5hLcJ9DwbPO3rkAuPZbWpirKy9e2ug3/ ZWPw== MIME-Version: 1.0 X-Received: by 10.182.251.138 with SMTP id zk10mr4595693obc.72.1424385306302; Thu, 19 Feb 2015 14:35:06 -0800 (PST) Sender: morrison.levi@gmail.com Received: by 10.76.90.74 with HTTP; Thu, 19 Feb 2015 14:35:06 -0800 (PST) In-Reply-To: References: Date: Thu, 19 Feb 2015 15:35:06 -0700 X-Google-Sender-Auth: 1tG3bry5gavEgbmm9tfeiY-mlhc Message-ID: To: Adam Harvey Cc: PHP internals Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] [RFC] Comparable: the revenge From: levim@php.net (Levi Morrison) >> But even here I would rather just take a function instead of requiring >> it to be the instance of some interface: >> >> function sort($input, callable $comparator($a, $b): int) { >> /* =E2=80=A6 */ >> } > > Fair, but the sorting case isn't the only one that matters, > particularly with <=3D> now as part of the language. For completeness: I advocate accepting a comparator in every case where custom comparison logic is needed, not just for sorting.