From: arnout at argeweb dot nl Operating system: Windows NT 5.2 / Windows 2003 PHP version: 4.3.6 PHP Bug Type: COM related Bug description: passing classes as a parameter
Description: ------------ I'm trying to pass a COM class into a member function of another COM class object. The second object chokes. One class is the connection with the database. The second is something that needs to connect. Reproduce code: --------------- $Conn = new COM("some.Conn"); $Conn->Connect( 'database', 'user', 'pass'); // this object is works fine. $Customer = new COM("some.Customer"); $Customer->Connect( $Conn ); // KLABAM! Expected result: ---------------- I'd expect the $Customer->Connect() function to accept the $Conn as being a "Conn" object and just connect. Actual result: -------------- "Error number: 97 Error description: Can not call friend function on object which is not an instance of defining class" This error comes from the object. The Customer->Connect function calls a friend function to do something with the Conn object. This function does not believe the object is a living Conn object and spittes it out. The whole thing works perfectly in C, VC++, VB, Jscript, VBscript (ASP) and Delphi. I've called the company that made the DLL, and they think the Conn object I pass isn't a real Conn object, but a simulation / emulation. Or a "COM" object of course. I've tried converting it to a more MS-like thing with the VARIANT class, but it doesn't seem to do much good. (type mismatch) So is this a PHP problem, or didn't the ones who made the DLL read the COM specifications too well? -- Edit bug report at http://bugs.php.net/?id=28179&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28179&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28179&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=28179&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=28179&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=28179&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=28179&r=needscript Try newer version: http://bugs.php.net/fix.php?id=28179&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=28179&r=support Expected behavior: http://bugs.php.net/fix.php?id=28179&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=28179&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=28179&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=28179&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28179&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=28179&r=dst IIS Stability: http://bugs.php.net/fix.php?id=28179&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=28179&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=28179&r=float