I'm attempting to convert:
usort($discounts, function ($a, $b) use ($c, $d){
$value1 = $c->do_action($a, $d, $d->value);
$value2 = $c->do_action($b, $d, $d->value);
return $value1 == $value2 ? 0 : ($value1 > $value2 ? 1 : -1);
});
Into a function that can be used in 5.2
Which so far I assumed I could do like this:
create_function( '$a, $b use ($that, $d)', ' $value1 = $c->do_action($a, $d, $d->value); $value2 = $c->do_action($b, $d, $d->value);return $value1 == $value2 ? 0 : ($value1 > $value2 ? 1 : -1);');
but you can't do use($c,$d)
inside the first param.