Bug #68316 [NEW]: array_keys 2 parameter not NULL

From: Date: Tue, 28 Oct 2014 08:57:49 +0000
Subject: Bug #68316 [NEW]: array_keys 2 parameter not NULL
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188336@lists.php.net to get a copy of this message
From: alexpts at yandex dot ru Operating system: mac os 10.10 PHP version: 5.5.18 Package: *General Issues Bug Type: Bug Bug description:array_keys 2 parameter not NULL Description: ------------ 1. Different default value for $search_value in doc http://ru2.php.net/manual/ru/function.array-keys.php http://ru2.php.net/manual/en/function.array-keys.php $search_value not work 'null' Test script: --------------- $result1 = array_keys(['id' => 1]); // ['id'] $result2 = array_keys(['id' => 1], null); // [] $expected = ['id']; echo $expected === $result1 ? 1 : 0; // 1 true echo $expected === $result2 ? 1 : 0; // 0 false Expected result: ---------------- ['id'] Actual result: -------------- [] -- Edit bug report at https://bugs.php.net/bug.php?id=68316&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=68316&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=68316&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=68316&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=68316&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=68316&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=68316&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=68316&r=needscript Try newer version: https://bugs.php.net/fix.php?id=68316&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=68316&r=support Expected behavior: https://bugs.php.net/fix.php?id=68316&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=68316&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=68316&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=68316&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=68316&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=68316&r=dst IIS Stability: https://bugs.php.net/fix.php?id=68316&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=68316&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=68316&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=68316&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=68316&r=mysqlcfg

« previous php.bugs (#188336) next »