3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $array = ['a' => ['a' => 1, 'b' => 2], 'b'=> ['a' => 0, 'b' => 1]]; usort($array, function($a, $b) { return $a['a'] <=> $b['a'] ?: $a['b'] <=> $b['b']; }); var_dump($array);
based on Ih0IX
Output for hhvm-3.18.4 - 3.21.0, 7.0.0 - 7.3.0beta1
array(2) { [0]=> array(2) { ["a"]=> int(0) ["b"]=> int(1) } [1]=> array(2) { ["a"]=> int(1) ["b"]=> int(2) } }
Output for 5.6.0 - 5.6.30
Parse error: syntax error, unexpected '>' in /in/gUTDa on line 6
Process exited with code 255.