File:
[ELWIX - Embedded LightWeight unIX -] /
embedaddon /
php /
ext /
standard /
tests /
array /
array_diff_ukey_basic.phpt
Revision
1.1.1.1 (vendor branch):
download - view:
text,
annotated -
select for diffs -
revision graph
Tue Feb 21 23:48:02 2012 UTC (12 years, 6 months ago) by
misho
Branches:
php,
MAIN
CVS tags:
v5_4_3elwix,
v5_4_29p0,
v5_4_29,
v5_4_20p0,
v5_4_20,
v5_4_17p0,
v5_4_17,
v5_3_10,
HEAD
php
--TEST--
array_diff_ukey() : Basic test.
--FILE--
<?php
/*
* proto array array_diff_ukey ( array $array1, array $array2 [, array $ ..., callback $key_compare_func] )
* Function is implemented in ext/standard/array.c
*/
function key_compare_func($key1, $key2) {
if ($key1 == $key2) return 0;
else if ($key1 > $key2) return 1;
else return -1;
}
$array1 = array('blue' => 1, 'red' => 2, 'green' => 3, 'purple' => 4);
$array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8);
var_dump(array_diff_ukey($array1, $array2, 'key_compare_func'));
?>
--EXPECT--
array(2) {
["red"]=>
int(2)
["purple"]=>
int(4)
}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>