Bug #69939 [Ver->Fbk]: Casting object to bool returns false
Edit report at https://bugs.php.net/bug.php?id=69939&edit=1
ID: 69939
Updated by: kalle@php.net
Reported by: bugzilla77 at gmail dot com
-Summary: Casting COM object to bool returns false
+Summary: Casting object to bool returns false
-Status: Verified
+Status: Feedback
Type: Bug
Package: *General Issues
Operating System: Windows
PHP Version: 7.0.0alpha2
Block user comment: N
Private report: N
New Comment:
Can you test to confirm if this differs between 32 bit and 64 bit builds of PHP 7.0.0 Alpha 2 and if
possible if it happens on non Windows on 7.0.0 Alpha 2?
If you don't have the chance to, then its fine and simply put the ticket back to
"Open", thanks
Previous Comments:
------------------------------------------------------------------------
[2015-06-26 12:56:12] cmb@php.net
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)
------------------------------------------------------------------------
[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
Thread (6 messages)