1--TEST-- 2Test array_diff_key() function : usage variation - Passing multi-dimensional array 3--FILE-- 4<?php 5/* Prototype : array array_diff_key(array arr1, array arr2 [, array ...]) 6 * Description: Returns the entries of arr1 that have keys which are not present in any of the others arguments. 7 * Source code: ext/standard/array.c 8 */ 9 10echo "*** Testing array_diff_key() : usage variation ***\n"; 11 12// Initialise function arguments not being substituted (if any) 13$array1 = array( 14 15 'first' => array('blue' => 1, 'red' => 2), 16 17 'second' => array('yellow' => 7), 18 19 'third' => array(0 => 'zero'), 20); 21 22$array2 = array ( 23 24 'first' => array('blue' => 1, 'red' => 2,), 25 26 'second' => array('cyan' => 8), 27 28 'fourth' => array(2 => 'two'), 29); 30 31echo "\n-- Testing array_diff_key() function with multi dimensional array --\n"; 32var_dump( array_diff_key($array1, $array2) ); 33var_dump( array_diff_key($array2, $array1) ); 34?> 35===DONE=== 36--EXPECTF-- 37*** Testing array_diff_key() : usage variation *** 38 39-- Testing array_diff_key() function with multi dimensional array -- 40array(1) { 41 ["third"]=> 42 array(1) { 43 [0]=> 44 string(4) "zero" 45 } 46} 47array(1) { 48 ["fourth"]=> 49 array(1) { 50 [2]=> 51 string(3) "two" 52 } 53} 54===DONE===