Return to array_fill_keys_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array |
1.1 misho 1: --TEST-- 2: Test 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: 11: echo "*** Testing array_fill_keys() : error conditions ***\n"; 12: 13: $keys = array(1, 2); 14: $val = 1; 15: $extra_arg = 10; 16: 17: echo "\n-- Testing array_fill_keys() function with more than expected no. of arguments --\n"; 18: var_dump( array_fill_keys($keys, $val, $extra_arg) ); 19: 20: echo "\n-- Testing array_fill_keys() function with less than expected no. of arguments --\n"; 21: var_dump( array_fill_keys($keys) ); 22: 1.1.1.2 ! misho 23: echo "\n-- Testing array_fill_keys() function with no arguments --\n"; 1.1 misho 24: var_dump( array_fill_keys() ); 25: 26: echo "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: 33: Warning: array_fill_keys() expects exactly 2 parameters, 3 given in %sarray_fill_keys_error.php on line %d 34: NULL 35: 36: -- Testing array_fill_keys() function with less than expected no. of arguments -- 37: 38: Warning: array_fill_keys() expects exactly 2 parameters, 1 given in %sarray_fill_keys_error.php on line %d 39: NULL 40: 1.1.1.2 ! misho 41: -- Testing array_fill_keys() function with no arguments -- 1.1 misho 42: 43: Warning: array_fill_keys() expects exactly 2 parameters, 0 given in %sarray_fill_keys_error.php on line %d 44: NULL 45: Done