Bug #79248 [NEW]: Traversing empty VT_ARRAY throws com_exception
| From: | cmb@php.net | Date: | Sat, 08 Feb 2020 15:51:50 +0000 |
| Subject: | Bug #79248 [NEW]: Traversing empty VT_ARRAY throws com_exception | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-225453@lists.php.net to get a copy of this message | ||
From: cmb
Operating system: Windows only
PHP version: 7.3Git-2020-02-08 (Git)
Package: COM related
Bug Type: Bug
Bug description:Traversing empty VT_ARRAY throws com_exception
Description:
------------
When an empty VT_ARRAY (i.e. a VT_ARRAY without any elements) is
traversed via foreach, a com_exception ("index out of bounds") is
thrown, what does not match the usual semantics of traversing
empty collections.
Test script:
---------------
<?php
$v = new variant([], VT_ARRAY);
foreach ($v as $el) {
var_dump($el);
}
echo "done\n";
?>
Expected result:
----------------
done
Actual result:
--------------
Fatal error: Uncaught com_exception: index out of bounds in
C:\php-sdk\phpdev\vc15\x64\com.php:3
Stack trace:
#0 {main}
thrown in C:\php-sdk\phpdev\vc15\x64\com.php on line 3
--
Edit bug report at https://bugs.php.net/bug.php?id=79248&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=79248&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=79248&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=79248&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=79248&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=79248&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=79248&r=support
Expected behavior: https://bugs.php.net/fix.php?id=79248&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=79248&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=79248&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=79248&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=79248&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=79248&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=79248&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=79248&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=79248&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=79248&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=79248&r=mysqlcfg