Bug #77705 [Opn->Fbk]: array_search のバグ

From: Date: Thu, 07 Mar 2019 12:29:43 +0000
Subject: Bug #77705 [Opn->Fbk]: array_search のバグ
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-219879@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: kalle@php.net Reported by: giuxon0924 at gmail dot com Summary: array_search のバグ -Status: Open +Status: Feedback Type: Bug Package: *General Issues Operating System: mac PHP Version: 7.3.3 Block user comment: N Private report: N New Comment: Could you please re-phrase the issue in english? Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#219879) next »