|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15655 Variant type & COM objects
Submitted: 2002-02-21 04:46 UTC Modified: 2002-03-11 12:59 UTC
From: bartek at vemco dot pl Assigned:
Status: Closed Package: COM related
PHP Version: 4.1.1 OS: WinNT SP6
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: bartek at vemco dot pl
New email:
PHP Version: OS:


 [2002-02-21 04:46 UTC] bartek at vemco dot pl
I have 2 COM objects and I want to pass 1 of them to another by reference.
Apache 1.3.23

//first object is ADODB.recordset
$recordset= new COM("ADODB.Recordset") or die("recodset down");
//I want this object to be passed by reference so i declare Variant type

$rs=new Variant($recordset);

//below lines are unimportant because I got Internal Server ERROR here

$object2= new COM("object.object") or die ("object down");

when I declare $rs = new Variant() or $rs= new Variant(VT_DISPATCH) then script works but object2 reports type mismatch

error_log raports: Premature end of script headers: c:/php/php.exe


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-11 12:59 UTC]
you shouldn't have to encapsulate the $recordset instance into a VARIANT() object as this is done by the com layer implicitely. the VARIANT() class is only necessary if you want multiple indirections (e.g. you want to pass a pointer to the instance instead of the instance itself). so passing $recordset to $object2 should be enough.


ps: if you still have troubles please also test it with the cgi version to check if it is apache related or a general com issue.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Tue Dec 06 17:05:53 2022 UTC