PHP Fatal error: Call to a member function getScore() on a non-object in
<p>this is my first question</p>

<p>I Have following class</p>

<pre><code>class ProDetection {
public function ProDetection ( ) { }
public function detect($word) {
    ............
}
public function getScore() {
    return $score;
}
}

class SaveDetection {
public function SaveDetection($words) {
    $proDetection = new ProDetection();
    for($i=0;$i&lt;sizeof($words);$i++) {
        $proDetection-&gt;detect($words[$i]);
    }
}
public function getScore() {
    return $this-&gt;proDetection-&gt;getScore();\\line 22
}
}
</code></pre>

<p>in other PHP file, i'm try to calling SaveDetection to getScore();</p>

<pre><code>$konten = "xxxx xxxx xxx";
$save = new SaveDetection($konten);
print_r( $save-&gt;getScore() );
</code></pre>

<p>But i got an error message</p>

<p>Notice: Undefined property: SaveDetection::$proDetection in C:\xampp\htdocs\inovasi\SaveDetection.php on line 22</p>

<p>Fatal error: Call to a member function getScore() on a non-object in C:\xampp\htdocs\inovasi\SaveDetection.php on line 22</p>

<p>Please need your help</p>
