|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2011-09-17 15:20 UTC] 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.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 04:00:01 2025 UTC |
Expected result: ---------------- PHP 5.3.9RC1 prints: Microsoft Windows Actual result: -------------- PHP 5.4.0RC1 crash <?php $z=50;while($z--){ $o=new COM('WinMgmts:',null,CP_UTF8); foreach($o->ExecQuery('SELECT * FROM Win32_OperatingSystem') as $x){ $s=$x->Caption; } } print($s); ?>