I don't think it is possible. When you call a function you pass an object, not a variable. The function doesn't care where the object came from.
You can go the other way though if you call your function as follows:
getName('foo')
Or pass both the value and the name:
getName(foo, 'foo')