I am having problem in accessing variables in class here's the code
class Text {
private $text = '';
private $words = '';
// function to initialise $words
private function filterText($value,$type) {
$words = $this->words;
echo count($words); // works returns a integer
if($type == 'length') {
echo count($words); // not works returns 0
}
$this->words = $array;
}
// even this fails
public function filterMinCount($count) {
$words = $this->words;
echo count($words);
if(true){
echo 'bingo'.count($words);
}
}
}
Can any one tell me the reason