TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
600 B
31 lines
600 B
--TEST--
|
|
array_diff_ukey() : Basic test.
|
|
--FILE--
|
|
<?php
|
|
/*
|
|
* 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;
|
|
}
|
|
}
|
|
function main()
|
|
{
|
|
$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)
|
|
}
|
|
|