- Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14
- array ( 0 => 'A', 4 => 'E', 6 => 'G', 2 => 'CC', 3 => 'DD', 5 => 'FF', 1 => 'BBB', )
<?php
$arr = ['A', 'BBB', 'CC', 'DD', 'E', 'FF', 'G'];
uasort($arr, fn ($a, $b) => strlen($a) <=> strlen($b));
var_export($arr);