12b1a4118SAnt Phillips--TEST--
2782352c5SPeter KokotTest array_fill_keys() function : error conditions
32b1a4118SAnt Phillips--FILE--
42b1a4118SAnt Phillips<?php
52b1a4118SAnt Phillips/* Prototype  : proto array array_fill_keys(array keys, mixed val)
6782352c5SPeter Kokot * Description: Create an array using the elements of the first parameter as keys each initialized to val
72b1a4118SAnt Phillips * Source code: ext/standard/array.c
8782352c5SPeter Kokot * Alias to functions:
92b1a4118SAnt Phillips */
102b1a4118SAnt Phillips
112b1a4118SAnt Phillipsecho "*** Testing array_fill_keys() : error conditions ***\n";
122b1a4118SAnt Phillips
132b1a4118SAnt Phillips$keys = array(1, 2);
142b1a4118SAnt Phillips$val = 1;
152b1a4118SAnt Phillips$extra_arg = 10;
162b1a4118SAnt Phillips
172b1a4118SAnt Phillipsecho "\n-- Testing array_fill_keys() function with more than expected no. of arguments --\n";
182b1a4118SAnt Phillipsvar_dump( array_fill_keys($keys, $val, $extra_arg) );
192b1a4118SAnt Phillips
202b1a4118SAnt Phillipsecho "\n-- Testing array_fill_keys() function with less than expected no. of arguments --\n";
212b1a4118SAnt Phillipsvar_dump( array_fill_keys($keys) );
222b1a4118SAnt Phillips
2304145dc2SVeres Lajosecho "\n-- Testing array_fill_keys() function with no arguments --\n";
242b1a4118SAnt Phillipsvar_dump( array_fill_keys() );
252b1a4118SAnt Phillips
262b1a4118SAnt Phillipsecho "Done";
272b1a4118SAnt Phillips?>
282b1a4118SAnt Phillips--EXPECTF--
292b1a4118SAnt Phillips*** Testing array_fill_keys() : error conditions ***
302b1a4118SAnt Phillips
312b1a4118SAnt Phillips-- Testing array_fill_keys() function with more than expected no. of arguments --
322b1a4118SAnt Phillips
332b1a4118SAnt PhillipsWarning: array_fill_keys() expects exactly 2 parameters, 3 given in %sarray_fill_keys_error.php on line %d
342b1a4118SAnt PhillipsNULL
352b1a4118SAnt Phillips
362b1a4118SAnt Phillips-- Testing array_fill_keys() function with less than expected no. of arguments --
372b1a4118SAnt Phillips
382b1a4118SAnt PhillipsWarning: array_fill_keys() expects exactly 2 parameters, 1 given in %sarray_fill_keys_error.php on line %d
392b1a4118SAnt PhillipsNULL
402b1a4118SAnt Phillips
4104145dc2SVeres Lajos-- Testing array_fill_keys() function with no arguments --
422b1a4118SAnt Phillips
432b1a4118SAnt PhillipsWarning: array_fill_keys() expects exactly 2 parameters, 0 given in %sarray_fill_keys_error.php on line %d
442b1a4118SAnt PhillipsNULL
452b1a4118SAnt PhillipsDone
46