I don't understand what you're trying to do.
In a double-quoted string, a dollar sign followed by a character string constitutes a variable reference that will be expanded to the value of the variable.
If you want that to happen, proceed as you are doing ... but you'll need to assign some value to $óñÿ, or it will expand to nothingness (an interesting concept, when you think about it).
If that is NOT what you want to do, use single quotes around the string:
$test=entities('$óñÿ + $ ó ñ ÿ');
echo($test);