|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-07-17 01:22 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 05:00:01 2025 UTC |
Documention states: array_search( mixed needle... However: $a = array( array( "test" ) ); echo array_search( array( "test" ), $a ) Outputs: Warning: Wrong datatype for first argument in call to array_search Whereas: foreach( $a as $key => $value ) { if( $value === array( "test" ) ) { echo $key; } } Outputs: 0 Either the documentation is incorrect to state that needle is mixed type, or the function should be fixed to allow mixed input. Preferably the latter. Also in general, the array functions do not properly handle nested arrays. For example, one can not array_diff() arrays that contain arrays. Although this might be by design, it is a significant handicap (limitation) and the functions should be made more robust.