Current behavior
In the section "Sort items by a custom method", the provided example function still works with numbered indices like $item[0]
Expected behavior/output
The example should work with labeled indices like $item['label'] or $item['value']
Links
https://docs.typo3.org/m/typo3/reference-tca/main/en-us/ColumnsConfig/Type/Select/Single/Index.html#sort-items-by-a-custom-method
TYPO3 versions
12, 13, main
Possible Solution
replace $item1[0] and $item2[0] with $item1['label'] and $item2['label'] respectively