Edit report at https://bugs.php.net/bug.php?id=63029&edit=1

 ID:                 63029
 Updated by:         larue...@php.net
 Reported by:        svens94 at yahoo dot de
 Summary:            comparison error
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            Arrays related
 Operating System:   Debian 6.0.5
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

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

the internal implementation is correct.  you can refer to ext/array.c


Previous Comments:
------------------------------------------------------------------------
[2012-09-07 09:49:31] svens94 at yahoo dot de

Description:
------------
---
>From manual page: http://www.php.net/function.array-uintersect#refsect1-
function.array-uintersect-description
---
array_uintersect (and other intersect-functions with callback) maybe link 
wrong..
the callback get some data a second time or nothing
or it gets 2 from the same array


Test script:
---------------
function compTest($first, $second)
{
 echo "<br> first:".$first." second: ".$second;
 if($first == $second) return 0;
 return 1;
}

array_uintersect(range(1,3),range(1,3),"comptest");
<hr>
array_uintersect(range(1,2),range(4,5),"comptest");

Expected result:
----------------
1->1
1->2
1->3
and so on...
_____
1->4
1->5
2->4
2->5

Actual result:
--------------
first:2 second: 1
first:3 second: 2
first:2 second: 1
first:3 second: 2
first:1 second: 1
first:1 second: 2
first:2 second: 2
first:2 second: 3
first:3 second: 3
________
first:2 second: 1
first:5 second: 4
first:1 second: 4
first:1 second: 5


------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=63029&edit=1

Reply via email to