Bug #77705 [Fbk->Nab]: array_search ã®ãã°
| From: | nikic@php.net | Date: | Thu, 07 Mar 2019 12:30:00 +0000 |
| Subject: | Bug #77705 [Fbk->Nab]: array_search ã®ãã° | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-219880@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=77705&edit=1
ID: 77705
Updated by: nikic@php.net
Reported by: giuxon0924 at gmail dot com
Summary: array_search ã®ãã°
-Status: Feedback
+Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: mac
PHP Version: 7.3.3
Block user comment: N
Private report: N
New Comment:
var_dump(0 == 'aa'); // bool(true)
See also https://wiki.php.net/rfc/string_to_number_comparison.
Previous Comments:
------------------------------------------------------------------------
[2019-03-07 12:29:43] kalle@php.net
Could you please re-phrase the issue in english?
------------------------------------------------------------------------
[2019-03-07 12:21:53] giuxon0924 at gmail dot com
Description:
------------
needleãæ°åã®0ã®å ´åãfalseã«ãªãã¹ãã§ãããint(0)ã«ãªãã
Test script:
---------------
# 0ã®å ´å
var_dump(array_search(0, ['aa', 'bb']));
int(0)ã
âNG
var_dump(array_search(0, [âaaâ, âbbâ], true));
bool(false)
âOK
# 1ã®å ´å
var_dump(array_search(1, ['aa', 'bb']));
bool(false)
âOK
var_dump(array_search(1, [âaaâ, âbbâ], true));
bool(false)
âOK
Expected result:
----------------
var_dump(array_search(0, ['aa', 'bb']));
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=77705&edit=1