This should be a big help in writing clean server-side sorts by an arbitrary column in tabular data.<p>Previously we've had to do some rather ugly things with "create_function" and lots of escaping in order to make arbitrary sort comparator functions.<p>An example of the old style:<p><pre><code> private function makeCompare($field, $desc) {
return create_function('$a,$b', "
\$r = strcasecmp(\$a['$field'], \$b['$field']);
return " . ($desc ? '-1' : '1') . " * \$r;");
}
</code></pre>
Not my proudest moment, to be sure.