I’m trying to use __callStatic to wrap the calls to differents static functions in my class. This current version of the code allows me to do so with functions that have 0 or 1 parameter: class …
Tag: static-methods
PHP static method call with variable class name and namespaces
I’m trying to call a static method for a namespaced class from another class with the same namespace. But the other class’ name is contained in a variable : Here is the Book class : My type variable contains a valid class name here Book. This class is in the same folder, and uses the same namespace. This code returns
Call static method from instance in PHP, future deprecation?
While I understand the $this variable is not available when a method is called in a static context, to assist in decoupling my application components from one-another I figured it would make sense to call static methods from an instance. For example: Are there plans to deprecate this sort of functionality, or am I right to expect support for this