title: Laravel's app() Container class magic __get with braces
body: <p>By debugging laravel in <code>$x = app()-&gt;resolved;</code> i get to this magic method</p>
  
  <pre><code>public function __get($key)
      {
          return $this[$key];
      }
  </code></pre>
  
  <p>in <code>Illuminate\Container\Container</code></p>
  
  <p>And I wanna understand that, but I can't figure out what this does.</p>
  
  <p>What is <code>return $this[$key];</code> ? <code>$this[$key]</code> like this is keyed array</p>
  
  <p>I understand that <code>$this-&gt;xxx</code> is getting $xxx property of <code>this</code> instance.</p>
  
  <p>But  what <code>$this[$key]</code> is?</p>
  
  <p>And why next line that is executing in code is</p>
  
  <pre><code>public function offsetGet($key)
      {
          return $this-&gt;make($key);
      }
  </code></pre>
  
  <p>Can't figure it out and understand even with debbuging now and thinking</p>