Annotation of embedaddon/php/ext/pcre/tests/preg_last_error_error.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Test preg_grep() function : error conditions - wrong numbers of parameters
! 3: --FILE--
! 4: <?php
! 5:
! 6: /* Prototype : int preg_last_error ( void )
! 7: * Description: Returns the error code of the last PCRE regex execution
! 8: * Source code: ext/pcre/php_pcre.c
! 9: */
! 10:
! 11: /*
! 12: * Pass an incorrect number of arguments to preg_last_error() to test behaviour
! 13: */
! 14:
! 15: echo "*** Testing preg_last_error() : error conditions ***\n";
! 16:
! 17: // Test preg_last_error with one more than the expected number of arguments
! 18: echo "\n-- Testing preg_last_error() function with more than expected no. of arguments --\n";
! 19: $extra_arg = 10;
! 20: var_dump( preg_last_error($extra_arg) );
! 21: ?>
! 22: ===Done===
! 23: --EXPECTF--
! 24: *** Testing preg_last_error() : error conditions ***
! 25:
! 26: -- Testing preg_last_error() function with more than expected no. of arguments --
! 27:
! 28: Warning: preg_last_error() expects exactly 0 parameters, 1 given in %s on line %d
! 29: NULL
! 30: ===Done===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>