PHP's magic methods question
<p>I store all variables settings for some project in a class named <code>Ini</code>. Variables are stored in group of arrays. For example, I have several arrays - one for 'database' related stuff, another for 'debug' related stuff and so on.</p>

<p>So to access for example some settings in my code i would type:</p>

<pre><code>$ini = new Ini();
echo $ini-&gt;database['user'];
echo $ini-&gt;debug['mode'];
</code></pre>

<p>I don't like my way of doing this. I would like to access variables stored inside <code>Ini</code> class like this:</p>

<pre><code>$ini-&gt;database-&gt;user;
</code></pre>

<p>or</p>

<pre><code>$ini-&gt;debug-&gt;mode;
</code></pre>

<p>The problem is that i am referencing non existing object inside another object. And i found no way to catch such call and return values stored in original <code>Ini</code> object (via PHP <code>__get()</code> method)</p>

<p>Would appreciate some help finding solution to my problem.</p>
