source: branches/version-2_5-dev/data/module/Compat/tests/function/array_diff_ukey.phpt @ 20119

Revision 20119, 652 bytes checked in by nanasess, 13 years ago (diff)

module 以下は svn:keywords を除外

  • Property svn:eol-style set to LF
Line 
1--TEST--
2Function -- array_diff_ukey
3--SKIPIF--
4<?php if (function_exists('array_diff_ukey')) { echo 'skip'; } ?>
5--FILE--
6<?php
7require_once 'PHP/Compat.php';
8PHP_Compat::loadFunction('array_diff_ukey');
9
10function key_compare_func($key1, $key2)
11{
12    if ($key1 == $key2) {
13        return 0;
14    } elseif ($key1 > $key2) {
15        return 1;
16    } else {
17        return -1;
18    }
19}
20
21$array1 = array('blue'  => 1, 'red'  => 2, 'green'  => 3, 'purple' => 4);
22$array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan'   => 8);
23
24print_r(array_diff_ukey($array1, $array2, 'key_compare_func'));
25
26?>
27--EXPECT--
28Array
29(
30    [red] => 2
31    [purple] => 4
32)
Note: See TracBrowser for help on using the repository browser.