|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-06-22 08:26 UTC] venaas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 17:00:02 2025 UTC |
The following code should demonstrate that unusual behavior (becaue I'm still not convinced that this is a bug) $input = array ( array (1,1), array (1,2), array(1,2), array(1,1) ); $result = array_unique ($input); print_r($result); The result is : Array ( [0] => Array ( [0] => 1 [1] => 1 ) ) This was not what I was expecting. I was expecting the following result : Array ( [0] => Array ( [0] => 1 [1] => 1 ) [1] => Array ( [0] => 1 [1] => 2 ) ) This is the result You get if You use PHP Version 4.0.4pl1 and before for example. So it is up to You, if You call this a bug or if I just have missused the function array_unique because I was not using a one dimensional array. Hopefully that helps You and me. Cheers Thomas