1--TEST-- 2Test array_count_values() function : Invalid parameters 3--FILE-- 4<?php 5/* Prototype : proto array array_count_values(array input) 6 * Description: Return the value as key and the frequency of that value in input as value 7 * Source code: ext/standard/array.c 8 * Alias to functions: 9 */ 10 11/* 12 * Test for handling of incorrect parameters. 13 */ 14 15echo "*** Testing array_count_values() : error conditions ***\n"; 16 17// Zero arguments 18echo "\n-- Testing array_count_values() function with Zero arguments --\n"; 19var_dump( array_count_values() ); 20 21//Test array_count_values with one more than the expected number of arguments 22echo "\n-- Testing array_count_values() function with more than expected no. of arguments --\n"; 23$input = array(1, 2); 24$extra_arg = 10; 25var_dump( array_count_values($input, $extra_arg) ); 26 27//Test array_count_values with integer arguments 28echo "\n-- Testing array_count_values() function integer arguments --\n"; 29var_dump( array_count_values(1 )); 30 31echo "Done"; 32?> 33--EXPECTF-- 34*** Testing array_count_values() : error conditions *** 35 36-- Testing array_count_values() function with Zero arguments -- 37 38Warning: array_count_values() expects exactly 1 parameter, 0 given in %sarray_count_values_error.php on line 16 39NULL 40 41-- Testing array_count_values() function with more than expected no. of arguments -- 42 43Warning: array_count_values() expects exactly 1 parameter, 2 given in %sarray_count_values_error.php on line 22 44NULL 45 46-- Testing array_count_values() function integer arguments -- 47 48Warning: array_count_values() expects parameter 1 to be array, integer given in %sarray_count_values_error.php on line 26 49NULL 50Done