Bug #55106 [Opn->Bgs]: About operator ===
| From: | aharvey@php.net | Date: | Fri, 01 Jul 2011 15:57:29 +0000 |
| Subject: | Bug #55106 [Opn->Bgs]: About operator === | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-161471@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=55106&edit=1
ID: 55106
Updated by: aharvey@php.net
Reported by: qq541921209 at gmail dot com
Summary: About operator ===
-Status: Open
+Status: Bogus
Type: Bug
Package: Unknown/Other Function
Operating System: Windows 7 & Windows Server 2008
PHP Version: 5.3.6
Block user comment: N
Private report: N
New Comment:
This isn't a bug. '4' - '0' results in $B being an integer with value 4,
which is
identical to $A, both in type and value.
Previous Comments:
------------------------------------------------------------------------
[2011-07-01 11:54:49] qq541921209 at gmail dot com
Description:
------------
In the PHP Manual it is said that:
"$a === $b Identical TRUE if $a is equal to $b, and they are of the
same type. (introduced in PHP 4)"
But when I test like that:
<?php
$A=4;
$B = '4' - '0';
echo '$A === $B ';
echo $A === $B?"true":"false";
//Out put $A === $B true
?>
I think $A and $B do not have same type, but there are in same values.
Is that a bugs?
I need help with this.
Test script:
---------------
<?php
$A=4;
$B = '4' - '0';
echo '$A === $B ';
echo $A === $B?"true":"false";
//Out put $A === $B true
?>
Expected result:
----------------
$A === $B true
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=55106&edit=1