Re: Expose compare_function() to userspace
| From: | Adam Harvey | Date: | Fri, 01 Oct 2010 02:52:09 +0000 |
| Subject: | Re: Expose compare_function() to userspace | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-49833@lists.php.net to get a copy of this message | ||
On 1 October 2010 06:26, Stas Malyshev <smalyshev@sugarcrm.com> 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