3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = ['A', 'BBB', 'CC', 'DD', 'E', 'FF', 'G']; uasort($arr, fn ($a, $b) => strlen($a) <=> strlen($b)); var_export($arr);

preferences:
36.43 ms | 405 KiB | 5 Q