Answer the question
In order to leave comments, you need to log in
How to make a method that could work both dynamic and static?
How to make a method that could work both dynamic and static?
If I called a static method, then I could return the desired object by the first argument, but if dynamically, then the object is already ready and I could work with it.
Now I do it through __callStatic and __call
Answer the question
In order to leave comments, you need to log in
In general, this is of course shiz, to do so, but:
1. Static methods can be safely called in a dynamic context.
2. There is such function func_get_args().
But you better not do it.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question