Then there must be something wrong which I cannot identify - please see the description in this thread:
[F] $eql() scheint Schreibweise zu ignorieren
It may be that it works with string constants but for some inexplicable reason it does not work with variables and the $upper function.