title: Load website configuration from JSON or PHP file?
body: <p>I've stored some website configuration data in a <code>config.json</code> file, with things like database connection parameters and routes. Something like this:</p>
  
  <pre class="lang-json prettyprint-override"><code>{
      "production" : { ... },
      "test" : { ... },
      "development" : { ... }
  }
  </code></pre>
  
  <p>And the content is loaded with:</p>
  
  <pre class="lang-php prettyprint-override"><code>$config = json_decode(file_get_contents('config'), true);
  </code></pre>
  
  <p>However, inspecting some frameworks, I see direct usage of PHP scripts for configuration storage:</p>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php
  return array(
      'production' =&gt; array( ... ),
      'test' =&gt; array( ... ),
      'development' =&gt; array( ... )
  );
  </code></pre>
  
  <pre class="lang-php prettyprint-override"><code>&lt;?php $config = (require 'config.php');
  </code></pre>
  
  <p>Which approach is the best?</p>