Bug #42551 [Asn->Nab]: new COM("HTMLFile") => warnings

From: Date: Tue, 07 Apr 2015 18:39:38 +0000
Subject: Bug #42551 [Asn->Nab]: new COM("HTMLFile") => warnings
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-191885@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=42551&edit=1

 ID:                 42551
 Updated by:         cmb@php.net
 Reported by:        csaba at alum dot mit dot edu
 Summary:            new COM("HTMLFile") => warnings
-Status:             Assigned
+Status:             Not a bug
 Type:               Bug
 Package:            COM related
 Operating System:   Win XP Pro
 PHP Version:        5.2.4
 Assigned To:        wharmby
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.




Previous Comments:
------------------------------------------------------------------------
[2009-03-17 13:23:02] csaba at alum dot mit dot edu

There is another variant of this which crops up from time to time (I am using version 5.2.6). 
Unfortunately, I cannot detect any pattern in when it happens.  It only happens with low frequency
(around 2 percent of the time), but when it happens my screen is filled with 31 error warnings.  The
following line

$oFSO = new COM("Scripting.FileSystemObject");

will (sometimes) cause 31 warnings of the following type:

Warning: com::com(): Type library constant BinaryCompare is already defined in
C:\phpScripts\myScript.php on line 32

The specific list of constants it complains about is:
BinaryCompare TextCompare DatabaseCompare ForReading ForWriting ForAppending TristateTrue
TristateFalse TristateUseDefault TristateMixed Normal ReadOnly Hidden System Volume Directory
Archive Alias Compressed UnknownType Removable Fixed Remote CDRom RamDisk WindowsFolder SystemFolder
TemporaryFolder StdIn StdOut StdErr

This has even happened when the script was the very first thing that I ran after a reboot.

In any case, I would expect that if the value of the constants is the same, then I not get the
complaint.

------------------------------------------------------------------------
[2007-09-05 12:44:45] jani@php.net

Assigned to the maintainer.

------------------------------------------------------------------------
[2007-09-04 21:13:55] csaba at alum dot mit dot edu

Description:
------------
When I attempt to do
$doc = new COM("HTMLFile");
this results in warnings that Type Library constants True and False are already defined.  Otherwise,
the script runs fine.

The equivalent code as a .vbs file runs wihtout complaints

Csaba Gabor from Vienna

Reproduce code:
---------------
<?php
$doc = new COM("HTMLFile");
$win = $doc->parentWindow;
print ($doc->location . "\n");

$win->ExecScript(
  "window.keepLooping=true");
$win->setTimeout (
  "alert('timeout works');
   window.keepLooping=false;", 2000);

while ($win->keepLooping)
  com_message_pump(200);
print ("Done Looping");
?>

Expected result:
----------------
The only thing I expect to see printed is:
about:blank
Done Looping

Actual result:
--------------
Warning: com::com(): Type library constant True is already defined in C:\test2.php on line 2

Warning: com::com(): Type library constant False is already defined in C:\test2.php on line 2
about:blank
Done Looping


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=42551&edit=1


Thread (4 messages)

« previous php.bugs (#191885) next »