Is there a compelling reason to not use debug_backtrace for the sole purpose of determining the calling method\'s class, name, and parameter list? Not for debugging purposes
You said in a comment
The callee's task is to call the same method that called it on a different computer. It's to avoid having a different API function for every possible source, which reduced the amount of code in the system considerably. Is it still bad
So you want to do the following:
Assuming, of course, that you use HTTP requests to fire off the remote call.
This is a bit of a strange set up. If you are creating the system from scratch then I'd suggest trying to work around it. If you're shoehorning it into a legacy system then I suppose I understand.
I'd suggest that you always be more explicit when you can. Your use of magic stack introspection might save you a little bit of coding, but to another developer your code will be completely baffling. If'dsuggest that you pass the class and function name to the function that was previously doing the reflection. Then there is no ambiguity about what is happening.