3v4l.org

run code in 300+ PHP versions simultaneously
<?php $things = [ [ 'foo' => 5.5, 'bar' => 'abc' ], [ 'foo' => 7.7, 'bar' => 'xyz' ], [ 'foo' => 2.2, 'bar' => 'efg' ] ]; // Sort $things by 'foo' property, ascending usort($things, function ($a, $b) { return $a['foo'] <=> $b['foo']; }); // Sort $things by 'bar' property, descending usort($things, function ($a, $b) { return $b['bar'] <=> $a['bar']; });

preferences:
60.59 ms | 402 KiB | 5 Q