3v4l.org

run code in 300+ PHP versions simultaneously
<?php $countries = [ ['id' => 1, 'text' => 'Burma'], ['id' => 2, 'text' => 'Zimbabwe'], ['id' => 3, 'text' => 'France'], ['id' => 4, 'text' => 'United States'], ['id' => 5, 'text' => 'Russia'], ]; usort( $countries, fn($a, $b) => [$a['text'] !== 'United States', $a['text']] <=> [$b['text'] !== 'United States', $b['text']] ); var_export($countries);
Output for 7.4.0 - 7.4.33, 8.0.1 - 8.0.30, 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30, 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
array ( 0 => array ( 'id' => 4, 'text' => 'United States', ), 1 => array ( 'id' => 1, 'text' => 'Burma', ), 2 => array ( 'id' => 3, 'text' => 'France', ), 3 => array ( 'id' => 5, 'text' => 'Russia', ), 4 => array ( 'id' => 2, 'text' => 'Zimbabwe', ), )

preferences:
95.57 ms | 1303 KiB | 4 Q