Jamie Rumbelow Jamie Rumbelow - 9 months ago 41
PHP Question

How do I check in PHP that I'm in a static context (or not)?

Is there any way I can check if a method is being called statically or on an instantiated object?


Try the following:

class Foo {
   function bar() {
      $static = !(isset($this) && get_class($this) == __CLASS__);

Source: seancoates.com via Google