#37881 [Opn->Bgs]: Flow error (&= (boolexpr))
| From: | mgf@php.net | Date: | Thu, 22 Jun 2006 08:52:07 +0000 |
| Subject: | #37881 [Opn->Bgs]: Flow error (&= (boolexpr)) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-98649@lists.php.net to get a copy of this message | ||
ID: 37881
Updated by: mgf@php.net
Reported By: freebsd at akruijff at dds dot nl
-Status: Open
+Status: Bogus
Bug Type: Unknown/Other Function
Operating System: FreeBSD
PHP Version: 5.1.4
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Your Boolean logic is wrong: 0 & 1 gives 0, not 1.
Previous Comments:
------------------------------------------------------------------------
[2006-06-22 05:10:05] freebsd at akruijff at dds dot nl
Description:
------------
Combining operaters fail when combining the sort version of the bit
operator + boolean expression
i.e. $flags &= ($msg != '');
Reproduce code:
---------------
$msg = 'xxx';
$flags = 0;
$flags &= ($msg != '');
echo $flags;
$flags &= ($msg != '') ? 1 : 0;
echo $flags;
$flags &= (($msg != '') ? 1 : 0);
echo $flags;
Expected result:
----------------
111
Actual result:
--------------
000
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37881&edit=1