import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-array / array_intersect_uassoc_variation6.php
blobaef8d889395c44c95ebf305a1bcdaee9a21ac659
1 <?php
2 /* Prototype : array array_intersect_uassoc(array arr1, array arr2 [, array ...], callback key_compare_func)
3 * Description: Computes the intersection of arrays with additional index check, compares indexes by a callback function
4 * Source code: ext/standard/array.c
5 */
7 echo "*** Testing array_intersect_uassoc() : usage variation ***\n";
9 //Initialize variables
10 $arr_float = array(0 => 1.00, 1.00 => 2.00);
11 $arr_string = array('1', '2', '3');
12 $arr_string_float = array('1.00', '2.00');
14 function key_compare_func($a, $b)
16 if ($a === $b) {
17 return 0;
19 return ($a > $b)? 1:-1;
22 echo "\n-- Result of floating points and strings containing integers intersection --\n";
23 var_dump( array_intersect_uassoc($arr_float, $arr_string, "key_compare_func") );
25 echo "\n-- Result of floating points and strings containing floating point intersection --\n";
26 var_dump( array_intersect_uassoc($arr_float, $arr_string_float, "key_compare_func") );
28 ===DONE===