Fix getFlatList for different PHP versions.