Return to array_multisort_error.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / array |
1.1 misho 1: --TEST-- 2: Test array_multisort() function : error conditions 3: --FILE-- 4: <?php 5: /* Prototype : bool array_multisort(array ar1 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING]], ...]) 6: * Description: Sort multiple arrays at once similar to how ORDER BY clause works in SQL 7: * Source code: ext/standard/array.c 8: * Alias to functions: 9: */ 10: 11: echo "*** Testing array_multisort() : error conditions ***\n"; 12: 13: // Zero arguments 14: echo "\n-- Testing array_multisort() function with Zero arguments --\n"; 15: var_dump( array_multisort() ); 16: 17: echo "\n-- Testing array_multisort() function with repeated flags --\n"; 18: $ar1 = array(1); 19: var_dump( array_multisort($ar1, SORT_ASC, SORT_ASC) ); 20: 21: echo "\n-- Testing array_multisort() function with repeated flags --\n"; 22: $ar1 = array(1); 23: var_dump( array_multisort($ar1, SORT_STRING, SORT_NUMERIC) ); 24: 25: ?> 26: ===DONE=== 27: --EXPECTF-- 28: *** Testing array_multisort() : error conditions *** 29: 30: -- Testing array_multisort() function with Zero arguments -- 31: 32: Warning: array_multisort() expects at least 1 parameter, 0 given in %sarray_multisort_error.php on line %d 33: NULL 34: 35: -- Testing array_multisort() function with repeated flags -- 36: 37: Warning: array_multisort(): Argument #3 is expected to be an array or sorting flag that has not already been specified in %sarray_multisort_error.php on line %d 38: bool(false) 39: 40: -- Testing array_multisort() function with repeated flags -- 41: 42: Warning: array_multisort(): Argument #3 is expected to be an array or sorting flag that has not already been specified in %sarray_multisort_error.php on line %d 43: bool(false) 44: ===DONE===