title: PHP - Update public variable
body: <p>Here's what I'm doing:</p>
  
  <pre><code>&lt;?php
  $csvObj = new Csv2Parser($file);
  $csvObj-&gt;loopContents();
  $csvObj-&gt;looplimitrows = 9; // why does this get ignored?
  ?&gt;
  </code></pre>
  
  <p>This <strong>looplimitrows</strong> is always returning <strong>5</strong> rows, instead of the <strong>9</strong> I am wanting.
  Am I not doing it right?</p>
  
  <p>Here's the Class:</p>
  
  <pre><code>class Csv2Parser
  {
      private $filepath; 
  
      public $looplimitrows = 5; 
  
      /*
        .... __construct() goes here...
      */
  
      public function loopContents(){
        $looplimitrows = $this-&gt;looplimitrows;
        $linecount=0;
        $fp = fopen($targetFile, "r"); // open the file
        while ($line = fgetcsv($fp)) {
        $linecount++;
  
          if(!empty($looplimitrows) &amp;&amp; $linecount &gt; $looplimitrows){ break; }
  
          echo $line[0]; // first column only
  
        }//eof while()
  
  }
  </code></pre>