Annotation of embedaddon/php/ext/standard/tests/array/array_reverse_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test array_reverse() function : error conditions
! 3: --FILE--
! 4: <?php
! 5: /* Prototype : array array_reverse(array $array [, bool $preserve_keys])
! 6: * Description: Return input as a new array with the order of the entries reversed
! 7: * Source code: ext/standard/array.c
! 8: */
! 9:
! 10: echo "*** Testing array_reverse() : error conditions ***\n";
! 11:
! 12: // zero arguments
! 13: echo "\n-- Testing array_reverse() function with Zero arguments --\n";
! 14: var_dump( array_reverse() );
! 15:
! 16: // more than the expected number of arguments
! 17: echo "\n-- Testing array_diff() function with more than expected no. of arguments --\n";
! 18: $array = array(1, 2, 3, 4, 5, 6);
! 19: $extra_arg = 10;
! 20: var_dump( array_reverse($array, true, $extra_arg) );
! 21: var_dump( array_reverse($array, false, $extra_arg) );
! 22:
! 23: echo "Done";
! 24: ?>
! 25: --EXPECTF--
! 26: *** Testing array_reverse() : error conditions ***
! 27:
! 28: -- Testing array_reverse() function with Zero arguments --
! 29:
! 30: Warning: array_reverse() expects at least 1 parameter, 0 given in %s on line %d
! 31: NULL
! 32:
! 33: -- Testing array_diff() function with more than expected no. of arguments --
! 34:
! 35: Warning: array_reverse() expects at most 2 parameters, 3 given in %s on line %d
! 36: NULL
! 37:
! 38: Warning: array_reverse() expects at most 2 parameters, 3 given in %s on line %d
! 39: NULL
! 40: Done
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>