Calling member function from other member function in PHP?
<p>I'm a little confused about the situation shown in this code...</p>

<pre><code>class DirEnt
{
    public function PopulateDirectory($path)
    {
        ... code ...

        while ($file = readdir($folder))
        {
            is_dir($file) ? $dtype = DType::Folder : $dtype = Dtype::File;                       
            $this-&gt;push_back(new SomeClass($file, $dtype));
        }

        ... code ...
    }

    //Element inserter.
    public function push_back($element)
    {
        //Insert the element.
    }
}
</code></pre>

<p>Why do I need to use either <code>$this-&gt;push_back(new SomeClass($file, $dtype))</code> or  <code>self::push_back(new SomeClass($file, $dtype))</code> to call the member function push_back?  I cant seem to access it just by doing <code>push_back(new SomeClass($file, $dtype))</code> like I would have expected.  I read <a href="http://stackoverflow.com/questions/151969/php-self-vs-this">PHP: self vs. $this</a> but it didn't answer why I need one of them at all (or if I do at all, maybe I messed something else up).</p>

<p>Why is this specification required when the members are both non-static and in the same class?  Shouldn't all member functions be visible and known from other member functions in the same class?</p>

<p>PS: It works fine with $this-> and self:: but says the functions unknown when neither is present on the push_back call.</p>
