Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49833 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 65619 invoked from network); 1 Oct 2010 02:52:33 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 1 Oct 2010 02:52:33 -0000 Authentication-Results: pb1.pair.com header.from=adam@adamharvey.name; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=adam@adamharvey.name; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain adamharvey.name designates 209.85.214.170 as permitted sender) X-PHP-List-Original-Sender: adam@adamharvey.name X-Host-Fingerprint: 209.85.214.170 mail-iw0-f170.google.com Received: from [209.85.214.170] ([209.85.214.170:50713] helo=mail-iw0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 09/27-18648-0FC45AC4 for ; Thu, 30 Sep 2010 22:52:32 -0400 Received: by iwn37 with SMTP id 37so3798417iwn.29 for ; Thu, 30 Sep 2010 19:52:30 -0700 (PDT) Received: by 10.231.13.140 with SMTP id c12mr4902339iba.25.1285901549676; Thu, 30 Sep 2010 19:52:29 -0700 (PDT) MIME-Version: 1.0 Sender: adam@adamharvey.name Received: by 10.231.79.3 with HTTP; Thu, 30 Sep 2010 19:52:09 -0700 (PDT) In-Reply-To: <4CA50EA1.603@sugarcrm.com> References: <4CA4EF7D.9070205@sugarcrm.com> <4CA50EA1.603@sugarcrm.com> Date: Fri, 1 Oct 2010 10:52:09 +0800 X-Google-Sender-Auth: Jf5E07c2S7hpGZ85dxjl5fjPqQc Message-ID: To: Stas Malyshev Cc: Pierre Joye , PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Expose compare_function() to userspace From: aharvey@php.net (Adam Harvey) On 1 October 2010 06:26, Stas Malyshev wrote: >> Can we make it an operator-like (is_a for example) instead? It could >> be more efficient. > > Operator has a downside that you can't pass it as a parameter. We could have > something like <=> (spaceship operator!) or even cmp though :) Yeah, I think if it's going to be available, it has to be as a function so it can be used as a callback. I can cook up a patch for an operator version in addition to the functional version, although I don't know that the performance benefit would necessarily be worth the extra complication (or potential confusion for users of having two ways to skin the same cat). Adam