They'll never actually admit it though even if it was legal though. Companies would prefer to say they're looking for a better fit or something equally vague.
When you say "Next year it becomes illegal for them to do so", what specifically are you referring to? I didn't catch the reference.
Partially illegal. I'm 39, and it is perfectly legal for companies to tell me they won't hire me because I'm too old. Next year it becomes illegal for them to do so.