Bug #69941 [Asn]: Casting a Variant object to boolean makes it false

From: Date: Fri, 26 Jun 2015 14:37:02 +0000
Subject: Bug #69941 [Asn]: Casting a Variant object to boolean makes it false
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193914@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69941&edit=1 ID: 69941 Updated by: cmb@php.net Reported by: kalle@php.net Summary: Casting a Variant object to boolean makes it false Status: Assigned Type: Bug Package: COM related Operating System: Windows PHP Version: 7.0.0alpha2 Assigned To: kalle Block user comment: N Private report: N New Comment: It seems to me that is intended behavior. If the first parameter ($value) is ommitted a VT_EMPTY object is created, which is supposed to be treated as FALSE. The following yield TRUE, for instance: (bool) new VARIANT(1) (bool) new VARIANT("foo") (bool) new VARIANT(true) Previous Comments: ------------------------------------------------------------------------ [2015-06-26 14:17:00] kalle@php.net Description: ------------ Much like Bug #69939, this is the same is true for a Variant object: var_dump((boolean) new Variant); // bool(true) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69941&edit=1

« previous php.bugs (#193914) next »