Export to GitHub

php-excel - issue #3

Implode() doesn't work well with large arrays


Posted on Jun 12, 2007 by Happy Elephant

What steps will reproduce the problem? 1. Generate a very large Excel file (>7000 lines)

What is the expected output? What do you see instead?

You'll most likely get:

Allowed memory size of 16777216 bytes exhausted (tried to allocate 189 bytes) class-excel-xml.inc.php on line 188

I fixed this by changing the implode() line on 188 to the following for-loop:

    $length = count($this->lines);
    for($i=0; $i<$length; $i++) {
        echo $this->lines[$i] ."\n";
    }

Comment #1

Posted on Sep 10, 2009 by Swift Horse

Thanks a lot for your input! I have just created a new branch for the development of version 2 which will address this issue. Please check:

http://code.google.com/p/php-excel/source/browse/#svn/branches/version02

...for details.

Comment #2

Posted on Sep 10, 2009 by Happy Elephant

great! :-)

Comment #3

Posted on Sep 10, 2009 by Swift Horse

I will address this problem with a new version and/or a patch to version 1.

Comment #4

Posted on Sep 10, 2009 by Swift Horse

This issue is resolved with version 1.1. Version 1.1 is now available and should be fully compatible with code based on version 1.0. Please refer to the [http://code.google.com/p/php-excel/downloads/list download section] to retrieve the new version.

Status: Fixed

Labels:
Type-Defect Priority-Medium