- Fixed bug #29236 (memory error when wsdl-cache is enabled). (Dmitry)
- Fixed bug #29109 (SoapFault exception: [WSDL] Out of memory). (Dmitry)
- Fixed bug #29061 (soap extension segfaults). (Dmitry)
+- Added new functions :
+ . array_diff_key() (Andrey)
+ . array_diff_ukey() (Andrey)
+ . array_intersect_key() (Christiano Duarte)
+ . array_intersect_ukey() (Christiano Duarte)
- Added MDTM support to ftp_url_stat. (Sara)
- Added zlib stream filter suport. (Sara)
- Added bz2 stream filter support. (Sara)
#define DIFF_NORMAL 0
#define DIFF_ASSOC 1
+#define DIFF_KEY 2
#define DIFF_COMP_DATA_INTERNAL 0
#define DIFF_COMP_DATA_USER 1
#define DIFF_COMP_KEY_INTERNAL 0
#define INTERSECT_NORMAL 0
#define INTERSECT_ASSOC 1
+#define INTERSECT_KEY 2
#define INTERSECT_COMP_DATA_INTERNAL 0
#define INTERSECT_COMP_DATA_USER 1
#define INTERSECT_COMP_KEY_INTERNAL 0
php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type);
return;
}
- } else if (behavior == INTERSECT_ASSOC) {
+ } else if ((behavior == INTERSECT_ASSOC)
+ ||(behavior == INTERSECT_KEY)) {
+ /*
+ INTERSECT_KEY is subset of INTERSECT_ASSOC. When having the former
+ no comparison of the data is done (part of INTERSECT_ASSOC)
+ */
intersect_key_compare_func = array_key_compare;
if (data_compare_type == INTERSECT_COMP_DATA_INTERNAL
&&
key_compare_type == INTERSECT_COMP_KEY_INTERNAL) {
- /* array_intersect_assoc() */
+ /* array_intersect_assoc() or array_intersect_key() */
if (argc < 2) {
efree(args);
} else if (data_compare_type == INTERSECT_COMP_DATA_INTERNAL
&&
key_compare_type == INTERSECT_COMP_KEY_USER) {
- /* array_intersect_uassoc() */
+ /* array_intersect_uassoc() or array_intersect_ukey() */
if (argc < 3) {
efree(args);
*list = NULL;
if (behavior == INTERSECT_NORMAL) {
zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket *), intersect_data_compare_func TSRMLS_CC);
- } else if (behavior == INTERSECT_ASSOC) {
+ } else if ((behavior == INTERSECT_ASSOC) || (behavior == INTERSECT_KEY)) {
zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket *), intersect_key_compare_func TSRMLS_CC);
}
}
/* go through the lists and look for common values */
while (*ptrs[0]) {
- if (behavior == INTERSECT_ASSOC
+ if ((behavior == INTERSECT_ASSOC
+ || behavior == INTERSECT_KEY)
&&
key_compare_type == INTERSECT_COMP_KEY_USER) {
while (*ptrs[i] && (0 < (c = intersect_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
ptrs[i]++;
}
- } else if (behavior == INTERSECT_ASSOC) {
+ } else if (behavior == INTERSECT_ASSOC || behavior == INTERSECT_KEY) {
while (*ptrs[i] && (0 < (c = intersect_key_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
ptrs[i]++;
}
- if (!c && *ptrs[i]) { /* this means that ptrs[i] is not NULL so we can compare */
- /* and "c==0" is from last operation */
+ if ((!c && *ptrs[i]) && (behavior == INTERSECT_ASSOC)) {
+ /*
+ this means that ptrs[i] is not NULL so we can compare
+ and "c==0" is from last operation
+ in this branch of code we enter only when INTERSECT_ASSOC
+ since when we have INTERSECT_KEY compare of data is not
+ wanted.
+ */
if (data_compare_type == INTERSECT_COMP_DATA_USER) {
BG(user_compare_func_name) = args[arr_argc];
}
c = 1;
if (key_compare_type == INTERSECT_COMP_KEY_USER) {
BG(user_compare_func_name) = args[argc - 1];
- /* When KEY_USER the last parameter is always the callback */
+ /* When KEY_USER, the last parameter is always the callback */
}
/* we are going to the break */
} else {
if (0 <= intersect_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)) {
break;
}
- } else if (behavior == INTERSECT_ASSOC) {
+ } else if (behavior == INTERSECT_ASSOC || behavior == INTERSECT_KEY) {
/* no need of looping because indexes are unique */
break;
}
if (intersect_data_compare_func(ptrs[0]-1, ptrs[0] TSRMLS_CC)) {
break;
}
- } else if (behavior == INTERSECT_ASSOC) {
+ } else if (behavior == INTERSECT_ASSOC || behavior == INTERSECT_KEY) {
/* no need of looping because indexes are unique */
break;
}
efree(args);
}
+/* {{{ proto array array_intersect_key(array arr1, array arr2 [, array ...], callback data_compare_func)
+ Returns the entries of arr1 that have keys which are present in all the other arguments. Kind of equivalent to array_diff(array_keys($arr1), array_keys($arr2)[,array_keys(...)]). Equivalent of array_intersect_assoc() but does not do compare of the data. */
+PHP_FUNCTION(array_intersect_key)
+{
+ php_array_intersect(INTERNAL_FUNCTION_PARAM_PASSTHRU, INTERSECT_KEY,
+ INTERSECT_COMP_DATA_INTERNAL, INTERSECT_COMP_KEY_INTERNAL);
+}
+
+/* {{{ proto array array_intersect_ukey(array arr1, array arr2 [, array ...], callback key_compare_func)
+ Returns the entries of arr1 that have keys which are present in all the other arguments. Kind of equivalent to array_diff(array_keys($arr1), array_keys($arr2)[,array_keys(...)]). The comparison of the keys is performed by a user supplied function. Equivalent of array_intersect_uassoc() but does not do compare of the data. */
+PHP_FUNCTION(array_intersect_ukey)
+{
+ php_array_intersect(INTERNAL_FUNCTION_PARAM_PASSTHRU, INTERSECT_KEY,
+ INTERSECT_COMP_DATA_INTERNAL, INTERSECT_COMP_KEY_USER);
+}
+
+
/* {{{ proto array array_intersect(array arr1, array arr2 [, array ...])
Returns the entries of arr1 that have values which are present in all the other arguments */
PHP_FUNCTION(array_intersect)
php_error_docref(NULL TSRMLS_CC, E_WARNING, "data_compare_type is %d. This should never happen. Please report as a bug", data_compare_type);
return;
}
- } else if (behavior == DIFF_ASSOC) {
+ } else if ((behavior == DIFF_ASSOC) || (behavior == DIFF_KEY)) {
+ /*
+ DIFF_KEY is subset of DIFF_ASSOC. When having the former
+ no comparison of the data is done (part of DIFF_ASSOC)
+ */
diff_key_compare_func = array_key_compare;
if (data_compare_type == DIFF_COMP_DATA_INTERNAL
&&
key_compare_type == DIFF_COMP_KEY_INTERNAL) {
- /* array_diff_assoc() */
+ /* array_diff_assoc() or array_diff_key() */
if (argc < 2) {
efree(args);
} else if (data_compare_type == DIFF_COMP_DATA_INTERNAL
&&
key_compare_type == DIFF_COMP_KEY_USER) {
- /* array_diff_uassoc() */
+ /* array_diff_uassoc() or array_diff_ukey() */
if (argc < 3) {
efree(args);
*list = NULL;
if (behavior == DIFF_NORMAL) {
zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket *), diff_data_compare_func TSRMLS_CC);
- } else if (behavior == DIFF_ASSOC) {
+ } else if (behavior == DIFF_ASSOC || behavior == DIFF_KEY) {
zend_qsort((void *) lists[i], hash->nNumOfElements, sizeof(Bucket *), diff_key_compare_func TSRMLS_CC);
}
}
/* go through the lists and look for values of ptr[0] that are not in the others */
while (*ptrs[0]) {
- if (behavior == DIFF_ASSOC
+ if ((behavior == DIFF_ASSOC || behavior == DIFF_KEY)
&&
key_compare_type == DIFF_COMP_KEY_USER) {
while (*ptrs[i] && (0 < (c = diff_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
ptrs[i]++;
}
- } else if (behavior == DIFF_ASSOC) {
+ } else if (behavior == DIFF_ASSOC || behavior == DIFF_KEY) {
while (*ptrs[i] && (0 < (c = diff_key_compare_func(ptrs[0], ptrs[i] TSRMLS_CC)))) {
ptrs[i]++;
}
}
break;
} else if (behavior == DIFF_ASSOC) {
+ /*
+ In this branch is execute only when DIFF_ASSOC. If behavior == DIFF_KEY
+ data comparison is not needed - skipped.
+ */
if (*ptrs[i]) {
if (data_compare_type == DIFF_COMP_DATA_USER) {
BG(user_compare_func_name) = args[arr_argc];
}
if (diff_data_compare_func(ptrs[0], ptrs[i] TSRMLS_CC) != 0) {
+ /* the data is not the same */
c = -1;
if (key_compare_type == DIFF_COMP_KEY_USER) {
BG(user_compare_func_name) = args[argc - 1];
}
} else {
break;
+ /*
+ we have found the element in other arrays thus we don't want it
+ in the return_value -> delete from there
+ */
}
}
+ } else if (behavior == DIFF_KEY) {
+ /*
+ the behavior here differs from INTERSECT_KEY in php_intersect
+ since in the "diff" case we have to remove the entry from
+ return_value while when doing intersection the entry must not
+ be deleted.
+ */
+ break; /* remove the key */
}
}
}
if (diff_data_compare_func(ptrs[0] - 1, ptrs[0] TSRMLS_CC)) {
break;
}
- } else if (behavior == DIFF_ASSOC) {
+ } else if (behavior == DIFF_ASSOC || behavior == DIFF_KEY) {
/* in this case no array_key_compare is needed */
break;
}
if (diff_data_compare_func(ptrs[0]-1, ptrs[0] TSRMLS_CC)) {
break;
}
- } else if (behavior == DIFF_ASSOC) {
+ } else if (behavior == DIFF_ASSOC || behavior == DIFF_KEY) {
/* in this case no array_key_compare is needed */
break;
}
}
+/* {{{ proto array array_diff_key(array arr1, array arr2 [, array ...])
+ Returns the entries of arr1 that have keys which are not present in any of the others arguments. This function is like array_diff() but works on the keys instead of the values. The associativity is preserved. */
+PHP_FUNCTION(array_diff_key)
+{
+ php_array_diff(INTERNAL_FUNCTION_PARAM_PASSTHRU, DIFF_KEY,
+ DIFF_COMP_DATA_INTERNAL, DIFF_COMP_KEY_INTERNAL);
+}
+/* }}} */
+
+/* {{{ proto array array_diff_ukey(array arr1, array arr2 [, array ...], callback key_comp_func)
+ Returns the entries of arr1 that have keys which are not present in any of the others arguments. User supplied function is used for comparing the keys. This function is like array_udiff() but works on the keys instead of the values. The associativity is preserved. */
+PHP_FUNCTION(array_diff_ukey)
+{
+ php_array_diff(INTERNAL_FUNCTION_PARAM_PASSTHRU, DIFF_KEY,
+ DIFF_COMP_DATA_INTERNAL, DIFF_COMP_KEY_USER);
+}
+/* }}} */
+
+
/* {{{ proto array array_diff(array arr1, array arr2 [, array ...])
Returns the entries of arr1 that have values which are not present in any of the others arguments. */
PHP_FUNCTION(array_diff)
PHP_FE(array_rand, NULL)
PHP_FE(array_unique, NULL)
PHP_FE(array_intersect, NULL)
+ PHP_FE(array_intersect_key, NULL)
+ PHP_FE(array_intersect_ukey, NULL)
PHP_FE(array_uintersect, NULL)
PHP_FE(array_intersect_assoc, NULL)
PHP_FE(array_uintersect_assoc, NULL)
PHP_FE(array_intersect_uassoc, NULL)
PHP_FE(array_uintersect_uassoc, NULL)
PHP_FE(array_diff, NULL)
+ PHP_FE(array_diff_key, NULL)
+ PHP_FE(array_diff_ukey, NULL)
PHP_FE(array_udiff, NULL)
PHP_FE(array_diff_assoc, NULL)
PHP_FE(array_udiff_assoc, NULL)
PHP_FE(array_filter, NULL)
PHP_FE(array_map, NULL)
PHP_FE(array_chunk, NULL)
- PHP_FE(array_combine, NULL)
- PHP_FE(array_key_exists, NULL)
+ PHP_FE(array_combine, NULL)
+ PHP_FE(array_key_exists, NULL)
/* aliases from array.c */
PHP_FALIAS(pos, current, first_arg_force_ref)
PHP_FUNCTION(array_rand);
PHP_FUNCTION(array_unique);
PHP_FUNCTION(array_intersect);
+PHP_FUNCTION(array_intersect_key);
+PHP_FUNCTION(array_intersect_ukey);
PHP_FUNCTION(array_uintersect);
PHP_FUNCTION(array_intersect_assoc);
PHP_FUNCTION(array_uintersect_assoc);
PHP_FUNCTION(array_intersect_uassoc);
PHP_FUNCTION(array_uintersect_uassoc);
PHP_FUNCTION(array_diff);
+PHP_FUNCTION(array_diff_key);
+PHP_FUNCTION(array_diff_ukey);
PHP_FUNCTION(array_udiff);
PHP_FUNCTION(array_diff_assoc);
PHP_FUNCTION(array_udiff_assoc);
--- /dev/null
+--TEST--
+Test of the array_diff_key() and array_diff_ukey()
+--FILE--
+<?php
+$a = array(1, 6, 2, -20, 15, 1200, -2500);
+$b = array(0, 7, 2, -20, 11, 1100, -2500);
+$c = array(0, 6, 2, -20, 19, 1000, -2500);
+$d = array(3, 8,-2, -20, 14, 900, -2600);
+$a_f = array_flip($a);
+$b_f = array_flip($b);
+$c_f = array_flip($c);
+$d_f = array_flip($d);
+$i = 1;
+/* give nicer values */
+foreach ($a_f as $k=> &$a_f_el) { $a_f_el =$k*2;}
+foreach ($b_f as $k=> &$b_f_el) { $b_f_el =$k*2;}
+foreach ($c_f as $k=> &$c_f_el) { $c_f_el =$k*2;}
+foreach ($d_f as $k=> &$d_f_el) { $d_f_el =$k*2;}
+
+echo "------ Test $i --------\n";$i++;// 1
+var_dump(array_diff_key($a_f, $b_f));// keys -> 1, 6, 15, 1200
+var_dump(array_diff_ukey($a_f, $b_f, "comp_func"));// 1, 6, 15, 1200
+
+echo "------ Test $i --------\n";$i++;// 2
+var_dump(array_diff_key($a_f, $c_f));// keys -> 1, 15, 1200
+var_dump(array_diff_ukey($a_f, $c_f, "comp_func"));// 1, 15, 1200
+
+echo "------ Test $i --------\n";$i++;// 3
+var_dump(array_diff_key($a_f, $d_f));// 1, 6, 2, 15, 1200, -2500
+var_dump(array_diff_ukey($a_f, $d_f, "comp_func"));// 1, 6, 2, 15, 1200, -2500
+
+echo "------ Test $i --------\n";$i++;// 4
+var_dump(array_diff_key($a_f, $b_f, $c_f));// 1, 15, 1200
+var_dump(array_diff_ukey($a_f, $b_f, $c_f, "comp_func"));// 1, 15, 1200
+
+echo "------ Test $i --------\n";$i++;// 5
+var_dump(array_diff_key($a_f, $b_f, $d_f));// 1, 6, 15, 1200
+var_dump(array_diff_ukey($a_f, $b_f, $d_f, "comp_func"));// 1, 6, 15, 1200
+
+
+echo "------ Test $i --------\n";$i++;// 6
+var_dump(array_diff_key($a_f, $b_f, $c_f, $d_f));// 1, 15, 1200
+var_dump(array_diff_ukey($a_f, $b_f, $c_f, $d_f, "comp_func"));//1, 15, 1200
+
+
+echo "------ Test $i --------\n";$i++;// 7
+var_dump(array_diff_key($b_f, $c_f));// 7, 11, 1100
+var_dump(array_diff_ukey($b_f, $c_f, "comp_func"));//7, 11, 1100
+
+echo "------ Test $i --------\n";$i++;// 8
+var_dump(array_diff_key($b_f, $d_f));//0, 7, 2, 11, 1100, -2500
+var_dump(array_diff_ukey($b_f, $d_f, "comp_func"));//0, 7, 2, 11, 1100, -2500
+
+
+echo "------ Test $i --------\n";$i++;// 9
+var_dump(array_diff_key($b_f, $c_f, $d_f));// 7, 11, 1100
+var_dump(array_diff_ukey($b_f, $c_f, $d_f, "comp_func"));// 7, 11, 1000
+
+function comp_func($a, $b) {
+ if ($a === $b) return 0;
+ return ($a > $b)? 1:-1;
+
+}
+?>
+--EXPECTF--
+------ Test 1 --------
+array(4) {
+ [1]=>
+ &int(2)
+ [6]=>
+ &int(12)
+ [15]=>
+ &int(30)
+ [1200]=>
+ &int(2400)
+}
+array(4) {
+ [1]=>
+ int(2)
+ [6]=>
+ int(12)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+------ Test 2 --------
+array(3) {
+ [1]=>
+ int(2)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+array(3) {
+ [1]=>
+ int(2)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+------ Test 3 --------
+array(6) {
+ [1]=>
+ int(2)
+ [6]=>
+ int(12)
+ [2]=>
+ int(4)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+ [-2500]=>
+ &int(-5000)
+}
+array(6) {
+ [1]=>
+ int(2)
+ [6]=>
+ int(12)
+ [2]=>
+ int(4)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+ [-2500]=>
+ &int(-5000)
+}
+------ Test 4 --------
+array(3) {
+ [1]=>
+ int(2)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+array(3) {
+ [1]=>
+ int(2)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+------ Test 5 --------
+array(4) {
+ [1]=>
+ int(2)
+ [6]=>
+ int(12)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+array(4) {
+ [1]=>
+ int(2)
+ [6]=>
+ int(12)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+------ Test 6 --------
+array(3) {
+ [1]=>
+ int(2)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+array(3) {
+ [1]=>
+ int(2)
+ [15]=>
+ int(30)
+ [1200]=>
+ int(2400)
+}
+------ Test 7 --------
+array(3) {
+ [7]=>
+ &int(14)
+ [11]=>
+ &int(22)
+ [1100]=>
+ &int(2200)
+}
+array(3) {
+ [7]=>
+ int(14)
+ [11]=>
+ int(22)
+ [1100]=>
+ int(2200)
+}
+------ Test 8 --------
+array(6) {
+ [0]=>
+ int(0)
+ [7]=>
+ int(14)
+ [2]=>
+ int(4)
+ [11]=>
+ int(22)
+ [1100]=>
+ int(2200)
+ [-2500]=>
+ &int(-5000)
+}
+array(6) {
+ [0]=>
+ int(0)
+ [7]=>
+ int(14)
+ [2]=>
+ int(4)
+ [11]=>
+ int(22)
+ [1100]=>
+ int(2200)
+ [-2500]=>
+ &int(-5000)
+}
+------ Test 9 --------
+array(3) {
+ [7]=>
+ int(14)
+ [11]=>
+ int(22)
+ [1100]=>
+ int(2200)
+}
+array(3) {
+ [7]=>
+ int(14)
+ [11]=>
+ int(22)
+ [1100]=>
+ int(2200)
+}
--- /dev/null
+--TEST--
+Test of the array_intersect_key() and array_intersect_ukey()
+--FILE--
+<?php
+$a = array(1, 6, 2, -20, 15, 1200, -2500);
+$b = array(0, 7, 2, -20, 11, 1100, -2500);
+$c = array(0, 6, 2, -20, 19, 1000, -2500);
+$d = array(3, 8,-2, -20, 14, 900, -2600);
+
+$a_f = array_flip($a);
+$b_f = array_flip($b);
+$c_f = array_flip($c);
+$d_f = array_flip($d);
+
+/* give nicer values */
+foreach ($a_f as $k=> &$a_f_el) { $a_f_el =$k*2;}
+foreach ($b_f as $k=> &$b_f_el) { $b_f_el =$k*2;}
+foreach ($c_f as $k=> &$c_f_el) { $c_f_el =$k*2;}
+foreach ($d_f as $k=> &$d_f_el) { $d_f_el =$k*2;}
+
+var_dump(array_intersect_key($a_f, $b_f));// keys -> 2, -20, -2500
+var_dump(array_intersect_ukey($a_f, $b_f, "comp_func"));// 2, 20, -2500
+var_dump(array_intersect_key($a_f, $c_f));// keys -> 6, 2, -20, -2500
+var_dump(array_intersect_ukey($a_f, $c_f, "comp_func"));// 6, 2, -20, -2500
+var_dump(array_intersect_key($a_f, $d_f));// -20
+var_dump(array_intersect_ukey($a_f, $d_f, "comp_func"));// -20
+
+var_dump(array_intersect_key($a_f, $b_f, $c_f));// 2, -20, -2500
+var_dump(array_intersect_ukey($a_f, $b_f, $c_f, "comp_func"));// 2, -20, -2500
+var_dump(array_intersect_key($a_f, $b_f, $d_f));// -20
+var_dump(array_intersect_ukey($a_f, $b_f, $d_f, "comp_func"));// -20
+
+var_dump(array_intersect_key($a_f, $b_f, $c_f, $d_f));// -20
+var_dump(array_intersect_ukey($a_f, $b_f, $c_f, $d_f, "comp_func"));//-20
+
+
+var_dump(array_intersect_key($b_f, $c_f));// 0, 2, -20, -2500
+var_dump(array_intersect_ukey($b_f, $c_f, "comp_func"));//0, 2, -20, 2500
+
+var_dump(array_intersect_key($b_f, $d_f));// -20
+var_dump(array_intersect_ukey($b_f, $d_f, "comp_func"));// -20
+
+var_dump(array_intersect_key($b_f, $c_f, $d_f));// -20
+var_dump(array_intersect_ukey($b_f, $c_f, $d_f, "comp_func"));// -20
+
+
+echo "----- Now testing array_intersect() ------- \n";
+var_dump(array_intersect($a, $b_f));
+var_dump(array_uintersect($a, $b, "comp_func"));
+var_dump(array_intersect($a, $b, $c));
+var_dump(array_uintersect($a, $b, $c, "comp_func"));
+var_dump(array_intersect($a, $b, $c, $d));
+var_dump(array_uintersect($a, $b, $c, $d, "comp_func"));
+
+///////////////////////////////////////////////////////////////////////
+function comp_func($a, $b) {
+ if ($a === $b) return 0;
+ return ($a > $b)? 1:-1;
+
+}
+?>
+--EXPECTF--
+array(3) {
+ [2]=>
+ &int(4)
+ [-20]=>
+ &int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(3) {
+ [2]=>
+ int(4)
+ [-20]=>
+ int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(4) {
+ [6]=>
+ int(12)
+ [2]=>
+ int(4)
+ [-20]=>
+ int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(4) {
+ [6]=>
+ int(12)
+ [2]=>
+ int(4)
+ [-20]=>
+ int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(3) {
+ [2]=>
+ int(4)
+ [-20]=>
+ int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(3) {
+ [2]=>
+ int(4)
+ [-20]=>
+ int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(4) {
+ [0]=>
+ &int(0)
+ [2]=>
+ &int(4)
+ [-20]=>
+ &int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(4) {
+ [0]=>
+ int(0)
+ [2]=>
+ int(4)
+ [-20]=>
+ int(-40)
+ [-2500]=>
+ &int(-5000)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+array(1) {
+ [-20]=>
+ int(-40)
+}
+----- Now testing array_intersect() -------
+array(0) {
+}
+array(3) {
+ [2]=>
+ int(2)
+ [3]=>
+ int(-20)
+ [6]=>
+ int(-2500)
+}
+array(3) {
+ [2]=>
+ int(2)
+ [3]=>
+ int(-20)
+ [6]=>
+ int(-2500)
+}
+array(3) {
+ [2]=>
+ int(2)
+ [3]=>
+ int(-20)
+ [6]=>
+ int(-2500)
+}
+array(1) {
+ [3]=>
+ int(-20)
+}
+array(1) {
+ [3]=>
+ int(-20)
+}