Hi Alexander. If I run code like shown, with key_selector#1, I can see "echo in\n" executed, like expected.
But If I run code with key_selector#2 or key_selector#3, I never see "echo in\n" executed, $comparer is never executed. Sorting still works, but not with my custom comparer, just by alphabet.
I've digged into the sources, and I've found vendor\athari\yalinqo\YaLinqo\OrderedEnumerable.php:127
Using latest "composer require athari/yalinqo", v2.4.2
Hi Alexander. If I run code like shown, with key_selector#1, I can see "echo in\n" executed, like expected. But If I run code with key_selector#2 or key_selector#3, I never see "echo in\n" executed, $comparer is never executed. Sorting still works, but not with my custom comparer, just by alphabet.
I've digged into the sources, and I've found
vendor\athari\yalinqo\YaLinqo\OrderedEnumerable.php:127
If your code found current key selector function is the one from the cache, it never even tries to run provided custom comparer function.
I expect orderBy to always run comparer function if it is present. Thank you.