Jamie Rumbelow Jamie Rumbelow - 1 year ago 98
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?

Answer Source

Try the following:

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

Source: seancoates.com via Google

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download