1--TEST--
2Test array_fill_keys() function : error conditions
3--FILE--
4<?php
5/* Prototype  : proto array array_fill_keys(array keys, mixed val)
6 * Description: Create an array using the elements of the first parameter as keys each initialized to val
7 * Source code: ext/standard/array.c
8 * Alias to functions:
9 */
10
11echo "*** Testing array_fill_keys() : error conditions ***\n";
12
13$keys = array(1, 2);
14$val = 1;
15$extra_arg = 10;
16
17echo "\n-- Testing array_fill_keys() function with more than expected no. of arguments --\n";
18var_dump( array_fill_keys($keys, $val, $extra_arg) );
19
20echo "\n-- Testing array_fill_keys() function with less than expected no. of arguments --\n";
21var_dump( array_fill_keys($keys) );
22
23echo "\n-- Testing array_fill_keys() function with no argumets --\n";
24var_dump( array_fill_keys() );
25
26echo "Done";
27?>
28--EXPECTF--
29*** Testing array_fill_keys() : error conditions ***
30
31-- Testing array_fill_keys() function with more than expected no. of arguments --
32
33Warning: array_fill_keys() expects exactly 2 parameters, 3 given in %sarray_fill_keys_error.php on line %d
34NULL
35
36-- Testing array_fill_keys() function with less than expected no. of arguments --
37
38Warning: array_fill_keys() expects exactly 2 parameters, 1 given in %sarray_fill_keys_error.php on line %d
39NULL
40
41-- Testing array_fill_keys() function with no argumets --
42
43Warning: array_fill_keys() expects exactly 2 parameters, 0 given in %sarray_fill_keys_error.php on line %d
44NULL
45Done
46