Closed jamesls closed 10 years ago
Can you provide more information on how values are compared? For example, PHP's max
function lays out exactly how values are compared when they're mixed: http://php.net/manual/en/function.max.php
It wouldn't compare mixed values. The intent here was to bring parity to sort/min/max and sort_by/min_by/max_by. Currently sort* supports an array of numbers or an array of strings. The min/max should have the same behavior. Trying to mix types should have the same behavior as sort/sort_by which results in an error.
I think the current inconsistently is confusing with sort/sort_by. You can sort/sortby with arrays of strings, but not with the min/max_ functions. I'd propose updating the spec to support strings:
cc @mtdowling