1--TEST-- 2Test array_diff_ukey() function : usage variation - Passing null,unset and undefined variable indexed array 3--FILE-- 4<?php 5echo "*** Testing array_diff_ukey() : usage variation ***\n"; 6 7// Initialise function arguments not being substituted (if any) 8$input_array = array(10 => '10', "" => 'empty'); 9 10//get an unset variable 11$unset_var = 10; 12unset ($unset_var); 13 14$input_arrays = array( 15 'null indexed' => array(NULL => 'null 1', null => 'null 2'), 16 'undefined indexed' => array(@$undefined_var => 'undefined'), 17 'unset indexed' => array(@$unset_var => 'unset'), 18); 19 20foreach($input_arrays as $key =>$value) { 21 echo "\n--$key--\n"; 22 var_dump( array_diff_ukey($value, $input_array, 'strcasecmp') ); 23 var_dump( array_diff_ukey($input_array, $value, 'strcasecmp') ); 24} 25 26?> 27--EXPECT-- 28*** Testing array_diff_ukey() : usage variation *** 29 30--null indexed-- 31array(0) { 32} 33array(1) { 34 [10]=> 35 string(2) "10" 36} 37 38--undefined indexed-- 39array(0) { 40} 41array(1) { 42 [10]=> 43 string(2) "10" 44} 45 46--unset indexed-- 47array(0) { 48} 49array(1) { 50 [10]=> 51 string(2) "10" 52} 53