Bug #74412 [Opn->Nab]: Comparison of string with 0 (integer zero) is returning boolean true
[email protected] Tue, 11 Apr 2017 10:53:50 GMT
| Newsgroups | php.standards |
|---|---|
| Message-ID | <[email protected]> |
Edit report at https://bugs.php.net/bug.php?id=74412&edit=1 ID: 74412 Updated by: [email protected] Reported by: anil dot shinde1 at gmail dot com Summary: Comparison of string with 0 (integer zero) is returning boolean true -Status: Open +Status: Not a bug Type: Bug Package: PHP Language Specification Operating System: ubuntu0.16.04.4 PHP Version: 7.0.17 Block user comment: N Private report: N New Comment: This is because type juggling that occurs. Do strict comparisons instead (===) Previous Comments: ------------------------------------------------------------------------ [2017-04-11 10:49:43] anil dot shinde1 at gmail dot com Description: ------------ Comparison of string with 0 (integer zero) is returning boolean true php -r "var_dump('A' == 0);" bool(true) Test script: --------------- php -r "var_dump(('A' == 0));" bool(true) Expected result: ---------------- Comparison of string with 0 (integer zero) should return boolean false Actual result: -------------- bool(true) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74412&edit=1