title: Why can't PHP have a constant object?
body: <p>I have a key-value database table, where I store some settings.</p>
  
  <p>I would like to have these settings in a PHP constant object, since they shouldn't be editable.</p>
  
  <p>In PHP7 we can now do this:</p>
  
  <pre><code>define('MySettings', array(
      'title' =&gt; 'My title'
      // etc
  ));
  
  // And call it with
  echo MySettings['title'];
  </code></pre>
  
  <p>And it works great.</p>
  
  <p>But why can't I do:</p>
  
  <pre><code>define('MySettings', (object) array('title' =&gt; 'My title'));
  </code></pre>
  
  <p>So I could call it like this instead:</p>
  
  <pre><code>echo MySettings-&gt;title;
  // or
  echo MySettings::title;
  </code></pre>
  
  <p>This is only because I think it's quicker and prettier to type it as an object property/constant (<code>$obj-&gt;key</code>, <code>$obj::key</code>), than as array (<code>$array['key']</code>)</p>
  
  <p>Is there any reason this is not possible?</p>