A
A
ammorium2015-06-11 20:37:59
PHP
ammorium, 2015-06-11 20:37:59

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

1 answer(s)
A
Alexey Yakhnenko, 2015-06-11
@ayahnenko

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 question

Ask a Question

731 491 924 answers to any question