Create a function inside a function into a class?
<p>I'm trying to create some classes and i would like to use this syntax:</p>

<pre><code>$my = new My();
$my-&gt;field()-&gt;test('test');
</code></pre>

<p>I know how to do a <code>$my-&gt;test('test')</code>, it's easy - but I don't know how to add a <code>field()</code> attribute to make an easier comprehension of my class in my code.</p>

<p>I can guess it's something like a class into another class - extends - but i'm not sure about that so if you know how to do something similar.</p>

<p>I precise it's only for a better comprehension into my class. I mean the aim is to categorize functions in this <code>My</code> class.</p>

<p>Thank you :)</p>
