As Jeff points out, those change the context, not the scope.
The reason for this question came from dealing with passing parameters to a previously defined function that was being used as an AJAX callback (or called from an AJAX callback, I can’t remember now). I’ll see if I can come up with an example, but it might be a day or two because I’m working on different stuff today.
Well I had a look at trying to create an example, and I don’t think there is any real practical use to it. It’s more a theoretical question than a practical one.
My original problem that led me to asking this question was AJAXifying some code - some of the functions being called were relying on certain variables being in scope, which then weren’t in scope when called from an AJAX callback. If it was possible to change the execution scope, this problem could be avoided.
The simple solution, as Jeff points out, is to just modify those functions so that they take the variables as arguments.