Bug #61561 [Opn->Nab]: 0=='0000-00-00' is true
| From: | yohgaki@php.net | Date: | Fri, 30 Mar 2012 10:16:40 +0000 |
| Subject: | Bug #61561 [Opn->Nab]: 0=='0000-00-00' is true | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-169012@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=61561&edit=1
ID: 61561
Updated by: yohgaki@php.net
Reported by: sokkis at gmail dot com
Summary: 0=='0000-00-00' is true
-Status: Open
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: Gentoo
PHP Version: 5.3.10
Block user comment: N
Private report: N
New Comment:
use ===
It's a type juggling.
http://jp.php.net/manual/en/language.types.type-juggling.php
Previous Comments:
------------------------------------------------------------------------
[2012-03-30 10:00:36] sokkis at gmail dot com
I wrote some mistake.
'0000-00-00' is equal with 0. I think is false, because i have two "-"
in the string.
------------------------------------------------------------------------
[2012-03-30 09:58:39] sokkis at gmail dot com
Description:
------------
'0000-00-00' is equal with '000-00-00'. I think is false, because i have two
"-"
in the string.
Test script:
---------------
<?php echo 0=='0000-00-00'; ?>
Expected result:
----------------
0
Actual result:
--------------
1
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=61561&edit=1