title: What is the difference between static functions and function outside of a class in PHP?
body: <p>I need to have method to get something from a database, but I don't understand the difference between static and normal functions in PHP.</p>
  
  <p>Example code</p>
  
  <pre><code>class Item {
      public static function getDetail($arg) {
          $detail = $this-&gt;findProductId($arg);   
          return $detail;
      }
  
      private function findProductId($id) {
          //find product_id in database where id = $arg
          //return detail of product
      }
  }
  </code></pre>
  
  <p>and function outside of a class</p>
  
  <pre><code>function getDetail($arg) {
      $detail = findProductId($arg);
      return $detail;
  }
  </code></pre>
  
  <p>If I use <code>$item = Item::getDetail(15);</code> and <code>$item = getDetail(15);</code> — they're the same.</p>
  
  <ol>
  <li>What is the difference between static and function outside of a class?</li>
  <li>If they are difference, How to use static function and  function outside of a class? (I'd appreciate a really simple example.)</li>
  <li>What are the performance properties between static and  function outside of a class? Which is better?</li>
  </ol>