title: CodeIgniter: "Cannot redeclare class"
body: <p>Admittedly my OOPHP is a little shaky but I can't see what's wrong with this. In one of my controllers I'm including a utils sheet which, like the controller, extends the base <code>CI_Controller</code> class. This throws the fatal error:</p>
  
  <pre><code>Fatal error: Cannot redeclare class Utils in {file path}\utils.php on line 88
  </code></pre>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>class Dashboard extends CI_Controller {
  
      public function __construct() {
  
          //call parent constructor
          parent::__construct();
  
          //load utils
          require 'application/helpers/utils.php'; //&lt;-- utils loaded
          $this-&gt;utils = new Utils(); //&lt;-- utils instantiated
  
          //load Dashboard model
          $this-&gt;utils-&gt;load-&gt;model('dashboard');
  
      }
  
      //etc...
  
  }
  </code></pre>
  
  <p><strong>utils.php:</strong></p>
  
  <pre><code>class Utils extends CI_Controller {
  
      //prep for forms (on join or login views)
      public function prep_form() {
          $this-&gt;load-&gt;helper('form');
          $this-&gt;load-&gt;library('form_validation');
          $this-&gt;form_validation-&gt;set_error_delimiters('&lt;li&gt;', '&lt;/li&gt;');
      }
  
      //etc - more util methods
  
  }
  </code></pre>
  
  <p>Why does it think I'm RE-declaring <code>Utils</code> despite calling it and instantiating it only once? Weird thing is, I have another controller, for another part of the site, with this same pattern and it has no complaints.</p>
  
  <p>Finally, I tried moving the <code>require</code> instruction outside the controller, and changing it to <code>require_once</code> just in case something really was calling it twice, and in both cases the page just hangs, eventually resolving with no source code sent to the browser.</p>
  
  <p>Thanks in advance.</p>