Annotation of embedaddon/php/ext/standard/tests/array/array_intersect_uassoc_basic.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: array_intersect_uassoc(): Basic test
! 3: --FILE--
! 4: <?php
! 5: /*
! 6: * array array_intersect_uassoc ( array $array1, array $array2 [, array $..., callback $key_compare_func] )
! 7: * Function is implemented in ext/standard/array.c
! 8: */
! 9: function key_compare_func($a, $b) {
! 10: if ($a === $b) {
! 11: return 0;
! 12: }
! 13: return ($a > $b) ? 1 : -1;
! 14: }
! 15: $array1 = array("a" => "green", "b" => "brown", "c" => "blue", "red");
! 16: $array2 = array("a" => "green", "yellow", "red");
! 17: $result = array_intersect_uassoc($array1, $array2, "key_compare_func");
! 18: var_dump($result);
! 19: ?>
! 20: --EXPECT--
! 21: array(1) {
! 22: ["a"]=>
! 23: string(5) "green"
! 24: }
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>