/usr/share/php/tests/PHP_Compat/tests/function/array_intersect_ukey.phpt is in php-compat 1.6.0a3-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | --TEST--
Function -- array_intersect_ukey
--FILE--
<?php
require_once 'PHP/Compat/Function/array_intersect_ukey.php';
function key_compare_func($key1, $key2)
{
if ($key1 == $key2) {
return 0;
} elseif ($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);
print_r(php_compat_array_intersect_ukey($array1, $array2, 'key_compare_func'));
?>
--EXPECT--
Array
(
[blue] => 1
[green] => 3
)
|