PHP: How can I access / use a method within its own class?
<p>I am trying to figure out how to use a method within its own class. example:</p>

<pre><code>class demoClass
{
    function demoFunction1()
    {
        //function code here
    }

    function demoFunction2()
    {
        //call previously declared method
        demoFunction1();
    }
}
</code></pre>

<p>The only way that I have found to be working is when I create a new intsnace of the class within the method, and then call it. Example:</p>

<pre><code>class demoClass
{
    function demoFunction1()
    {
        //function code here
    }

    function demoFunction2()
    {
        $thisClassInstance = new demoClass();
        //call previously declared method
        $thisClassInstance-&gt;demoFunction1();
    }
}
</code></pre>

<p>but that does not feel right... or is that the way?
any help?</p>

<p>thanks</p>
