Bug #79248 [Asn->Csd]: Traversing empty VT_ARRAY throws com_exception

From: Date: Sat, 08 Feb 2020 16:09:09 +0000
Subject: Bug #79248 [Asn->Csd]: Traversing empty VT_ARRAY throws com_exception
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-225454@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=79248&edit=1 ID: 79248 Updated by: cmb@php.net Reported by: cmb@php.net Summary: Traversing empty VT_ARRAY throws com_exception -Status: Assigned +Status: Closed Type: Bug Package: COM related Operating System: Windows only PHP Version: 7.3Git-2020-02-08 (Git) Assigned To: cmb Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmbecker69@gmx.de Revision: http://git.php.net/?p=php-src.git;a=commit;h=f649adedfe3f0797cd0d6248e1b01c65b326f443 Log: Fix #79248: Traversing empty VT_ARRAY throws com_exception Previous Comments: ------------------------------------------------------------------------ [2020-02-08 15:51:50] cmb@php.net 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 this bug report at https://bugs.php.net/bug.php?id=79248&edit=1

« previous php.bugs (#225454) next »