Bug #69939 [Opn->Ver]: Casting COM object to bool returns false

From: Date: Fri, 26 Jun 2015 12:56:13 +0000
Subject: Bug #69939 [Opn->Ver]: Casting COM object to bool returns false
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-193907@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69939&edit=1 ID: 69939 Updated by: cmb@php.net Reported by: bugzilla77 at gmail dot com -Summary: Casting object to bool returns false +Summary: Casting COM object to bool returns false -Status: Open +Status: Verified Type: Bug Package: *General Issues Operating System: Windows PHP Version: 7.0.0alpha2 Block user comment: N Private report: N New Comment: Confirmed for COM objects, but not for objects in general, e.g. var_dump((bool) new StdClass); // => bool(true) var_dump((bool) new ArrayObject([])); // => bool(true) Previous Comments: ------------------------------------------------------------------------ [2015-06-26 12:15:14] bugzilla77 at gmail dot com Description: ------------ Casting object to bool returns false (in PHP 7.0) Old PHP 5.6 returns true. Test script: --------------- <?php var_dump((bool)new COM('WScript.Shell')); ?> Expected result: ---------------- true (like PHP 5.6) Actual result: -------------- false ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=69939&edit=1

« previous php.bugs (#193907) next »