1--TEST-- 2Test array_diff_assoc() function : error conditions - pass array_diff_assoc() too few/zero arguments 3--FILE-- 4<?php 5/* Prototype : array array_diff_assoc(array $arr1, array $arr2 [, array ...]) 6 * Description: Returns the entries of arr1 that have values which are not present 7 * in any of the others arguments but do additional checks whether the keys are equal 8 * Source code: ext/standard/array.c 9 */ 10 11/* 12 * Test errors for array_diff with too few\zero arguments 13 */ 14 15echo "*** Testing array_diff_assoc() : error conditions ***\n"; 16 17// Zero arguments 18echo "\n-- Testing array_diff_assoc() function with zero arguments --\n"; 19var_dump( array_diff_assoc() ); 20 21// Testing array_diff_assoc with one less than the expected number of arguments 22echo "\n-- Testing array_diff_assoc() function with less than expected no. of arguments --\n"; 23$arr1 = array(1, 2); 24var_dump( array_diff_assoc($arr1) ); 25 26 27echo "Done"; 28?> 29--EXPECTF-- 30*** Testing array_diff_assoc() : error conditions *** 31 32-- Testing array_diff_assoc() function with zero arguments -- 33 34Warning: array_diff_assoc(): at least 2 parameters are required, 0 given in %s on line %d 35NULL 36 37-- Testing array_diff_assoc() function with less than expected no. of arguments -- 38 39Warning: array_diff_assoc(): at least 2 parameters are required, 1 given in %s on line %d 40NULL 41Done 42