SO question Weird behaviour with triggering __callStatic() from non-static method is great because it explains the weird behaviour with the __callStatic not being called from within the class itself (Note that I don’t see this behaviour in 5.3.3 but in 5.3.8 and 5.3.12). It seems that the __callStatic can only be invoked from outside the class. That’s now a fact. But what do I do if I really want the __callStatic to be called from within my class? What syntax should I use to get over the issue?
SO question Weird behaviour with triggering __callStatic() from non-static method is great because it
Share
It does not have to be from outside the class, just not from object context (i.e. where
$thisis an instance of the class). So you can wrap this call in a static method, for example:Output: