Bug #67947 [Nab]: array_keys case-insensitive compare not work even if bool $strict false

From: Date: Tue, 02 Sep 2014 17:16:03 +0000
Subject: Bug #67947 [Nab]: array_keys case-insensitive compare not work even if bool $strict false
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187389@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67947&edit=1 ID: 67947 User updated by: rob_neal at rocketmail dot com Reported by: rob_neal at rocketmail dot com Summary: array_keys case-insensitive compare not work even if bool $strict false Status: Not a bug Type: Bug Package: Arrays related Operating System: Windows 8.1 PHP Version: 5.5.16 Block user comment: N Private report: N New Comment: Thank you for your reply. I now see that this is not a bug. In your reply you shared some useful information: "$strict has nothing to do with case sensitivity". Though the php docs need to be concise, it would be useful/helpful to add a short statement like that on all "strict" arguments for all functions with a link to learn more about exactly what "strict comparisons" mean and how it does not mean consideration of case-sensitivity. Previous Comments: ------------------------------------------------------------------------ [2014-09-02 16:34:39] requinix@php.net Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php $strict has nothing to do with case sensitivity. ------------------------------------------------------------------------ [2014-09-02 12:04:57] rob_neal at rocketmail dot com Description: ------------ Running PHP version 5.5.15 on XAMPP for Windows. This is latest version of XAMPP/PHP as of today's date. Only changes to default php.ini that I have made are about Mail and XDebug for debugging with Komodo IDE. Test script: --------------- $arr = array('uuu', 'abc','aBC','ABC','abc', 'Def', 'DEF', 'xyz'); //set 3rd argument as $strict=false for case-insensitive $k = array_keys($arr,'abc',false); print_r($k); Expected result: ---------------- Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 ) Actual result: -------------- Array ( [0] => 1 [1] => 4 ) ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=67947&edit=1

« previous php.bugs (#187389) next »