3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?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']; });
Output for hhvm-3.18.4 - 3.21.0, 7.0.0 - 7.3.0beta1
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected '>' in /in/jQUTH on line 20
Process exited with code 255.