Return to array_flip_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array |
1.1 misho 1: --TEST-- 2: Test array_flip() function : error conditions 3: --FILE-- 4: <?php 5: /* Prototype : array array_flip(array $input) 6: * Description: Return array with key <-> value flipped 7: * Source code: ext/standard/array.c 8: */ 9: 10: echo "*** Testing array_flip() : error conditions ***\n"; 11: 12: // Zero arguments 13: echo "-- Testing array_flip() function with Zero arguments --\n"; 14: var_dump( array_flip() ); 15: 16: //one more than the expected number of arguments 17: echo "-- Testing array_flip() function with more than expected no. of arguments --\n"; 18: $input = array(1 => 'one', 2 => 'two'); 19: $extra_arg = 10; 20: var_dump( array_flip($input, $extra_arg) ); 21: 22: echo "Done" 23: ?> 24: --EXPECTF-- 25: *** Testing array_flip() : error conditions *** 26: -- Testing array_flip() function with Zero arguments -- 27: 28: Warning: array_flip() expects exactly 1 parameter, 0 given in %s on line %d 29: NULL 30: -- Testing array_flip() function with more than expected no. of arguments -- 31: 32: Warning: array_flip() expects exactly 1 parameter, 2 given in %s on line %d 33: NULL 34: Done