title: PHP Class - public variable not displaying correctly outside class
body: <p>In myClass I have declared <code>$_total_results_found = 0</code></p>
  
  <p>Then in my function I changed the value of <code>$_total_results_found = 10</code></p>
  
  <p>But, when I try to call this outside myClass the value still shows me 0.</p>
  
  <p>Please can any one help me how to write this code?</p>
  
  <pre><code>class myClass
  {
    private $_total_rows_count = 0;
    public function foundResults()
    {
      $count = 10;
      $this-&gt;_total_rows_count = $count;
    }
  } // end myClass
  
  
  $myclass = new myClass();
  echo $myclass-&gt;_total_results_found; // Value is showing 0 instead of 10
  </code></pre>