Which is better: require_once? or if (!defined('FOOBAR')) require? or something entirely different?
<p>Assuming PHP version >= 5.2, which is a better solution for managing includes: </p>

<pre><code>require_once DEFPATH . 'config.inc.php';
</code></pre>

<p>or </p>

<pre><code>if (!defined('FOOBAR')) require DEFPATH . 'config.inc.php';
</code></pre>

<p>or something entirely different?</p>

<p>Site does not use a front controller or autoloader. Typical number of files needed to be included is 3 - 8.</p>

<p>I've heard, here and elsewhere, that <code>require_once</code> adds overhead and does not play nice with caching. But I've also heard that a small number of <code>require_once</code> statements is OK in practice in later versions of PHP.</p>

<p>There must also be some overhead associated with checking if something is defined, but that may be less of an issue.</p>

<p>In general, which is the better practice and why?</p>
