Edit report at https://bugs.php.net/bug.php?id=55715&edit=1
ID: 55715
Comment by: lunter at interia dot pl
Reported by: ystsoi at yahoo dot com dot hk
Summary: Iterating Excel worksheet cell values may crash PHP
Status: Open
Type: Bug
Package: COM related
Operating System: Windows XP SP3, Windows 7
PHP Version: 5.4.0beta1
Block user comment: N
Private report: N
New Comment:
Confirmed on PHP 5.4.0 RC1, Apache 2.2.21 VC9
Windows 7 32bit
Bug introduced in PHP 5.4
PHP 5.3.8 works fine.
Previous Comments:
------------------------------------------------------------------------
[2011-09-17 15:20:52] ystsoi at yahoo dot com dot hk
Description:
------------
When run the following test script, PHP will crash when it tries to get the
value of the second cell.
The problem will not occur if Cells() is not used within the for-loop.
Test script:
---------------
<?php
$excel = new COM("Excel.Application");
$excel->Workbooks->Open(realpath('test.xls'));
$worksheet = $excel->ActiveSheet;
for ($j = 1; $j <= 2; $j++) {
echo $worksheet->Cells(1, $j)->Value, "\n";
}
$excel->Quit();
?>
Expected result:
----------------
The values of A1 and B1 in test.xls will be echoed.
Actual result:
--------------
Only the value of A1 in test.xls is echoed, then crash.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55715&edit=1