Calling a function from within another function in PHP, but get error Using $this when not in object context
<p>I have the code below: from the getData function im trying to call <strong>get_xml</strong> within the same class, but I get the error <code>Using $this when not in object context</code> . I have been programming quite some time, so maybe my brains shut off, but imho this should work right? What am I missing here?</p>

<pre><code>class modDataHelper {

    function getData($rid) {
        $xml = $this-&gt;get_xml('http://www.dataserver.nl/rss/feed.php?id=' . $rid, 60000);

        return $xml;
    }

    function get_xml($url, $max_age) {
        $file = 'cache/' . md5($url);

        if (file_exists($file)
                &amp;&amp; filemtime($file) &gt;= time() - $max_age) {
            // the cache file exists and is fresh enough
            return simplexml_load_file($file);
        }

        $xml = file_get_contents($url);
        file_put_contents($file, $xml);
        return simplexml_load_string($xml);
    }

}
</code></pre>

<p>In another file I call </p>

<pre><code>$data = modDataHelper::getData(19464);
</code></pre>
