php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32038 com_print_typeinfo returning duplicate entries
Submitted: 2005-02-20 22:45 UTC Modified: 2005-04-18 18:41 UTC
From: csaba at alum dot mit dot edu Assigned:
Status: Wont fix Package: COM related
PHP Version: 5CVS-2005-02-20 OS: Win XP Pro
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2005-02-20 22:45 UTC] csaba at alum dot mit dot edu
Description:
------------
com_print_typeinfo is often showing duplicate entries for many of the properties of various COM objects, for example: IWebBrowser2

Reproduce code:
---------------
<?php
$oShell = new COM("Shell.Application");
$oWins = $oShell->Windows();
foreach ($oWins as $oWin) {
com_print_typeinfo($oWin,"IWebBrowser2");
break; }
?>

Expected result:
----------------
I expect each property to be listed exactly once

Actual result:
--------------
Here's part of the printout:
        /* DISPID=555 */
        /* VT_BOOL [11] */
        /* Controls whether address bar is shown */
        var $AddressBar;

        /* DISPID=555 */
        /* Controls whether address bar is shown */
        var $AddressBar;

        /* DISPID=556 */
        /* VT_BOOL [11] */
        /* Controls whether the window is resizable */
        var $Resizable;

        /* DISPID=556 */
        /* Controls whether the window is resizable */
        var $Resizable;


As you can see, both properties are shown twice.  The first of the two showings always shows the variant type (e.g.  VT_BOOL [11]) whereas the second does not.  It seems superfluous to have these shown twice (especially since the printouts are so voluminous and the second is a subset of the first).  I have not seen this happen with Methods.

Csaba Gabor from Vienna

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-18 18:41 UTC] wez@php.net
that function is mainly a debugging aid; all it does is walk through the list of available items in the type info.
The "duplicates" are present because the type info stores one record for get and another for set when dealing with properties.
While this function could be made smarter, I don't plan to do so; it just doesn't need to be made that complicated.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 12:01:27 2024 UTC