title: Defined PHP function returns function undefined
body: <p>I have a functions.php page with some functions, it is required in the default.php page which is required by all my other pages (index.php) at the first line.</p>
  
  <p>index.php (1st line after <code>&lt;?php</code></p>
  
  <pre><code>require("includes/default.php");
  </code></pre>
  
  <p>default.php</p>
  
  <pre><code>&lt;?php
  //mysql
  require("templates.php");
  require("functions.php");
  ?&gt;
  </code></pre>
  
  <p>functions.php</p>
  
  <pre><code>&lt;?php
  
  function rating_format($num) {
      if ($num &gt; 0) {
          return "+" . $num;
      }
      elseif ($num &lt; 0) {
          return "-" . $num;
      }
      else {
          return $num;
      }
  }
  
  function thumbnail_url($value) {
      if ($value == "") {
          return "no_favicon.png";
      }
      else {
          return $value;
      }
  }
  ?&gt;
  </code></pre>
  
  <p>I use both functions defined in functions.php in index.php. However, only the second function seems to be defined. Whenever trying to use the first function, it spits out an function undefined error.</p>
  
  <p>I've rearranged the code several times and don't know what is wrong with it. The function is defined before I even use it.</p>
  
  <p>Any help is appreciated.</p>