title: Can't understand a logic of Object And Array in php
body: <p>If I write this line on <code>routes/web.php</code> file</p>
  <pre><code>dd( app()['config'][&quot;auth.guards.web&quot;] );
  </code></pre>
  <p>It outputs this:</p>
  <pre><code>array:2 [▼
    &quot;driver&quot; =&gt; &quot;session&quot;
    &quot;provider&quot; =&gt; &quot;users&quot;
  ]
  </code></pre>
  <p>That's cool, but my question is since <code>app()['config']</code> returns an object so how this <code>[&quot;auth.guards.web&quot;]</code>works? Even there is no index with that name!</p>
  <p>Outside of Laravel I tried to write a class named Test so that it returns the same output but I got an error! Which is,</p>
  <pre><code>Fatal error: Uncaught Error: Cannot use object of type Test as array 
  </code></pre>
  <p>Can anyone explain it with core php?</p>