import zend standard tests
[hiphop-php.git] / hphp / test / zend / good / ext-standard-array / usort_error1.php
blob277faf23a4475d5182e6ce7b28e1f9f41f5e7b92
1 <?php
2 /* Prototype : bool usort(array $array_arg, string $cmp_function)
3 * Description: Sort an array by values using a user-defined comparison function
4 * Source code: ext/standard/array.c
5 */
7 /*
8 * Pass incorrect number of arguments to usort() to test behaviour
9 */
11 echo "*** Testing usort() : error conditions ***\n";
13 //Test usort with one more than the expected number of arguments
14 echo "\n-- Testing usort() function with more than expected no. of arguments --\n";
15 $array_arg = array(1, 2);
16 $cmp_function = 'string_val';
17 $extra_arg = 10;
18 var_dump( usort($array_arg, $cmp_function, $extra_arg) );
20 // Testing usort with one less than the expected number of arguments
21 echo "\n-- Testing usort() function with less than expected no. of arguments --\n";
22 $array_arg = array(1, 2);
23 var_dump( usort($array_arg) );
25 ===DONE===