Script dies, I'm not sure why
<p>I'm trying to parse a 6,000 line 500 KB file into an array so I can import the data into our system.  The problem is that the script stops executing somewhere between lines 3000-4000.  There are no breaks in the code, we use it on other imports.  Any ideas on why this might be happening and what I can do to prevent it?</p>

<pre><code>/**
 * Takes a seperated value string and makes it an array
 * @param $delimiter string The delimiter to be seperated by, usually a comma or tab
 * @param $string string The string to seperate
 * @return array The resulting array
 */
public function svToArray ($delimiter, $string) {
    $x = 0;
    $rowList = array();
    $splitContent = preg_split("#\n+#", trim($string));
    foreach ($splitContent as $key =&gt; $value) {
        $newData = preg_split("#".$delimiter."#", $value);
        if ($x == 0) {
            $headerValues = array_values($newData);
        } else {
            $tempRow = array();
            foreach ($newData as $rowColumnKey =&gt; $rowColumnValue) {                                                
                $tempRow[$headerValues[$rowColumnKey]] = $rowColumnValue;
            }
            $rowList[] = $tempRow;
        }
        $x++;
    }
    return $rowList;
}
</code></pre>

<p><strong>UPDATE:</strong>
Error reporting is enabled.  I've started using a file that's only 130KB at 1,500 lines and it does the same thing...</p>

<p>When I add debug code as in the following example nothing echoes at all unless I put an exit after the <code>echo "test&lt;br/&gt;";</code></p>

<pre><code>public function svToArray ($delimiter, $string) {
    $x = 0;
    $rowList = array();
    $splitContent = preg_split("#\n+#", trim($string));
    echo "test&lt;br/&gt;";
    foreach ($splitContent as $key =&gt; $value) {
        $newData = preg_split("#".$delimiter."#", $value);
        if ($x == 0) {
            $headerValues = array_values($newData);
        } else {
            $tempRow = array();
            foreach ($newData as $rowColumnKey =&gt; $rowColumnValue) {                                                
                $tempRow[$headerValues[$rowColumnKey]] = $rowColumnValue;
            }
            $rowList[] = $tempRow;
        }
        $x++;
    }
    echo "test";
    $this-&gt;tru-&gt;debug($rowList);
    exit;
    return $rowList;
}
</code></pre>

<p><strong>UPDATE</strong>
If I comment out <code>$tempRow[] = $rowColumnValue;</code> then it echoes everything fine....</p>
