1--TEST--
2Test 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|SORT_NATURAL|SORT_FLAG_CASE]] [, array ar2 [, SORT_ASC|SORT_DESC [, SORT_REGULAR|SORT_NUMERIC|SORT_STRING|SORT_NATURAL|SORT_FLAG_CASE]], ...])
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
11echo "*** Testing array_multisort() : error conditions ***\n";
12
13// Zero arguments
14echo "\n-- Testing array_multisort() function with Zero arguments --\n";
15var_dump( array_multisort() );
16
17echo "\n-- Testing array_multisort() function with repeated flags --\n";
18$ar1 = array(1);
19var_dump( array_multisort($ar1, SORT_ASC, SORT_ASC) );
20
21echo "\n-- Testing array_multisort() function with repeated flags --\n";
22$ar1 = array(1);
23var_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
32Warning: array_multisort() expects at least 1 parameter, 0 given in %sarray_multisort_error.php on line %d
33NULL
34
35-- Testing array_multisort() function with repeated flags --
36
37Warning: 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
38bool(false)
39
40-- Testing array_multisort() function with repeated flags --
41
42Warning: 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
43bool(false)
44===DONE===