#39922 [Opn->Bgs]: array_search returns incorrect position after array_push or array_unshift
| From: | tony2001@php.net | Date: | Thu, 21 Dec 2006 14:31:30 +0000 |
| Subject: | #39922 [Opn->Bgs]: array_search returns incorrect position after array_push or array_unshift | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-106736@lists.php.net to get a copy of this message | ||
ID: 39922
Updated by: tony2001@php.net
Reported By: willem at fkkc dot nl
-Status: Open
+Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Debian
PHP Version: 5.2.0
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2006-12-21 13:51:29] smlerman at gmail dot com
Fix your error_reporting and/or display_errors settings.
Warning: Wrong parameter count for array_search() in ... on line 4
http://www.php.net/manual/en/function.array-search.php
------------------------------------------------------------------------
[2006-12-21 11:40:41] willem at fkkc dot nl
Description:
------------
array_search returns incorrect position-value when an array is modified
with array_push or array_unshift
Reproduce code:
---------------
$array = array('a1','b2','c3');
array_unshift($array,'d4');
$pos = array_search('d4');
if($pos === FALSE){
print implode(',',$array);
}else{
print 'Position = '.$pos;
}
Expected result:
----------------
Position = 0
Actual result:
--------------
d4,a1,b2,c3
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39922&edit=1