title: Running out of memory with fgetcsv on large file
body: <p>I'm getting the following error:
  <code>Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 36 bytes)</code></p>
  
  <p>The line that it is failing on is <code>while (($dataInputRecord = fgetcsv($inputFile, $maxRowLength, ",")) !== FALSE)</code> from this block of code:</p>
  
  <pre><code>    if (($inputFile = fopen($fileName, "r")) !== FALSE) {
          while (($dataInputRecord = fgetcsv($inputFile, $maxRowLength, ",")) !== FALSE) {
              // do stuff
          }
          fclose($inputFile);
      }
  </code></pre>
  
  <p>The entire file is 32MB. Playing around with the size of <code>$maxRowLength</code> didn't help. I'm convinced that the problem is the file size, because truncating it to 8 KB solves the problem. How can I make it not care about file size?</p>
  
  <p>Edit: Looks like my boss was misleading me about what the code within the loop was supposed to do</p>