PHP5 COM get/set property trouble

From: Date: Wed, 03 Mar 2004 03:05:15 +0000
Subject: PHP5 COM get/set property trouble
Groups: php.general 
Request: Send a blank email to php-general+get-179329@lists.php.net to get a copy of this message
Hi, I'm having difficulty trying to use the com extension in php5. Here's the asp equivalent of what I'm trying to do. Set comobj = Server.CreateObject("MyComlib.ComLib") comobj.FieldValue = "somedata" myval = comobj.Property("Record") comobj.Property("Record") = "otherdata" My php code looks like this:
$comobj = &new COM('MyComlib.ComLib');         // Works
$comobj->FieldValue = "somedata";                           // Works
$myval = $comobj->Property("Record");                    // Kind of Works.....throws an exception if the value doesn't exist
$comobj->Property("Record") = "otherdata";              // Doesn't Work
I'm able to initialize the object and assign the FieldValue property some data. The last line however doesn't work and instead gives me: PHP Fatal error: Can't use method return value in write context It makes sense to me why that wouldn't work in php, but for the life of me I can't figure out what would make it work. I've tried with both the latest beta and the latest snaps release of php5 with the same results. I can't find any bug reports or mention of this happening to anyone, is this something that maybe just can't be done in php? Thanks, --Dan--

« previous php.general (#179329) next »