1--TEST--
2Test natcasesort() function : error conditions - Pass incorrect number of args
3--FILE--
4<?php
5/* Prototype  : bool natcasesort(array &$array_arg)
6 * Description: Sort an array using case-insensitive natural sort
7 * Source code: ext/standard/array.c
8 */
9
10/*
11 * Pass incorrect number of arguments to natcasesort() to test behaviour
12 */
13
14echo "*** Testing natcasesort() : error conditions ***\n";
15
16// Zero arguments
17echo "\n-- Testing natcasesort() function with Zero arguments --\n";
18var_dump( natcasesort() );
19
20// Test natcasesort with one more than the expected number of arguments
21echo "\n-- Testing natcasesort() function with more than expected no. of arguments --\n";
22$array_arg = array(1, 2);
23$extra_arg = 10;
24var_dump( natcasesort($array_arg, $extra_arg) );
25
26echo "Done";
27?>
28--EXPECTF--
29*** Testing natcasesort() : error conditions ***
30
31-- Testing natcasesort() function with Zero arguments --
32
33Warning: natcasesort() expects exactly 1 parameter, 0 given in %s on line %d
34NULL
35
36-- Testing natcasesort() function with more than expected no. of arguments --
37
38Warning: natcasesort() expects exactly 1 parameter, 2 given in %s on line %d
39NULL
40Done