Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:67342 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 80343 invoked from network); 7 May 2013 18:05:44 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 7 May 2013 18:05:44 -0000 Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.52 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.219.52 mail-oa0-f52.google.com Received: from [209.85.219.52] ([209.85.219.52:63715] helo=mail-oa0-f52.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 4E/71-06696-87249815 for ; Tue, 07 May 2013 14:05:44 -0400 Received: by mail-oa0-f52.google.com with SMTP id h1so1024400oag.11 for ; Tue, 07 May 2013 11:05:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=2n4wyI9/BQmoet7K+9N38k8Q5aYfC7R30VHHeAaEqqs=; b=y/xKfnSZlVOzhqE2jVyS40ojMnjGvHODSb/mZLafUlqe56wwP/vj6EuyHZjuW0nFbW 8avpojrrGAGhTdq6PbuJhHlR8bYmrG2q+kJB4tEQyl8G4KpTKTSCZk9bW3dXu/8kl3o0 cWQ7KO+gqfTcM+R1Cjj04zYz+3gA7ZoLQgHqGBLLUJPQEr+XovhfYa2SUKIDZZtETRUq vvHNRwIp619tyZnirWgmAQhHzHQgX8BLJ369EkO7FxlnjXiuGzF4yNSVcHKWSH7VO0d7 xQADR2FAhdaSOGWIhbZtsFlVgiaH8zwe2pvTTifK46jIIRmxUnuux6XoQP4/+qWCIoGh dPiw== MIME-Version: 1.0 X-Received: by 10.60.56.168 with SMTP id b8mr888190oeq.5.1367949941304; Tue, 07 May 2013 11:05:41 -0700 (PDT) Received: by 10.182.49.136 with HTTP; Tue, 7 May 2013 11:05:41 -0700 (PDT) In-Reply-To: References: Date: Tue, 7 May 2013 20:05:41 +0200 Message-ID: To: Thomas Anderson Cc: PHP internals Content-Type: multipart/alternative; boundary=089e0149ca9652ef1c04dc24aa17 Subject: Re: [PHP-DEV] idea: implement a Comparable interface From: nikita.ppv@gmail.com (Nikita Popov) --089e0149ca9652ef1c04dc24aa17 Content-Type: text/plain; charset=ISO-8859-1 On Tue, May 7, 2013 at 6:17 PM, Thomas Anderson wrote: > It'd be nice if, when doing $objA > $objB, that that'd invoke > $objA->__compareTo($objB) or something, much like Java's Comparable > interface. > Do you have examples of what this would be useful for? The two things that come to mind are DateTime (which can do this anyway as it's an internal class) and classes for bignums or something like that (which are probably also better implemented internally). So I'm not sure how much use there is for this. Nikita --089e0149ca9652ef1c04dc24aa17--