title: PhpStorm - How to detect PHP error "Non-static method should not be called statically"?
body: <p>With PHP, static method can be used in both static method and non-static method, and non-static method can only used in non-static method. That's why calling a dynamic method statically generates the <code>E_STRICT</code> error.</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;?php
  
  class Example
  {
      public function foo() {
          return "Foo";
      }
  
      public static function bar() {
          return "Bar";
      }
  }
  
  $ex = new Example();
  
  // Non-static call
  echo $ex-&gt;bar();
  
  // Static call on a non-static method
  // PHP Error "Strict standards: Non-static method should not be called statically"
  // ERROR NOT DETECTED BY PHPSTORM!
  echo Example::foo();
  </code></pre>
  
  <p>The last line will generated this PHP error (it's logic):
  <a href="https://i.stack.imgur.com/9Dogk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9Dogk.png" alt="enter image description here"></a></p>
  
  <p>I am currently working on a large PHP application that calls, in some PHP files, non-static methods statically.  It was not a problem with an very old version of PHP but we have decided to migrate to the latest PHP version. </p>
  
  <p>Manually check all the project files to identify this bad syntax will be too long (+ 1000 files)!</p>
  
  <p><strong>The built-in code inspection features of PhpStorm doesn't detect this type of error within the analyzed source code. Why? Should I configure something? How?</strong></p>
  
  <p>Below, my PHP code inspection configuration in PhpStorm:</p>
  
  <p><a href="https://i.stack.imgur.com/fUwfs.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fUwfs.png" alt="enter image description here"></a></p>
  
  <p>Thanks!</p>