this is the one, has anyone tested the actual cvs version ? > -----Original Message----- > From: Derick Rethans [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 04, 2001 10:24 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: [PHP-DEV] Bug #13433 Updated: Returning Booleans > from COM is broken in 407 > > > Hello, > > can you MFH this one too? > > Derick > > On 4 Oct 2001 [EMAIL PROTECTED] wrote: > > > ID: 13433 > > Updated by: phanto > > Reported By: [EMAIL PROTECTED] > > Status: Open > > Bug Type: COM related > > Operating System: Windows NT 4 Server > > PHP Version: 4.0CVS-2001-09-25 > > New Comment: > > > > fixed in cvs > > > > Previous Comments: > > > ---------------------------------------------------------------------- > > -- > > > > [2001-09-25 11:21:37] [EMAIL PROTECTED] > > > > In PHP 4.07 (RC1, RC2 and latest snapshot, standard windows build) > > returning a boolean from a COM object is broken. > > > > I reported this on PHP-QA a while ago but there was no > response to it. > > That report was primarily to do with returning booleans from a > > database accessed via an ADO COM object. But now I've > found it's true > > for all booleans. > > > > When you have a COM object returning a boolean, testing > that boolean > > for 'trueness' fails. > > > > The following script: > > > > <?php > > > > $obj = new COM('com.object'); > > > > $arg = $obj->TestFunc(); // Simple function that just > returns TRUE > > > > var_dump($arg); > > > > if ($arg == TRUE) > > echo "arg is true<BR>"; > > elseif ($arg == FALSE) > > echo "arg is false<BR>"; > > else > > echo "arg is something else<BR>"; > > > > if ($arg) > > echo "<BR>arg is true, but not equal to true<BR>"; > > ?> > > > > produces this output: > > > > >bool(true) > > >arg is something else > > > > > >arg is true, but not equal to true > > > > > > > Basically, if you test for equality to 'true' it fails, but > it's also > > not false. But if you just test directly on the value it > works fine. > > > > I stepped through the source and it appears to be due to the way > > comparison of booleans is done. The COM object returns a > boolean by > > creating a Variant of type BOOL and value -1. whereas PHP > creates a > > boolean of type BOOL and value 1. The comparison then > messes up due > > to this, I think. > > > > I've also tried this with PHP 4.06 and the problem doesn't occur in > > that version > > > > > ---------------------------------------------------------------------- > > -- > > > > > > > > Edit this bug report at http://bugs.php.net/?id=13433&edit=1 > > > > > > -- > > PHP Development Mailing List <http://www.php.net/> > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > To contact > > the list administrators, e-mail: [EMAIL PROTECTED] > > > > Derick Rethans > > --------------------------------------------------------------------- > PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED] > SRM: Site Resource Manager - www.vl-srm.net > --------------------------------------------------------------------- > >
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]