import zend pcre tests
[hiphop-php.git] / hphp / test / zend / good / ext-pcre / preg_grep_error.php
blob888e46cf066ca7d904493709a3973cb92c815509
1 <?php
2 /*
3 * proto array preg_grep(string regex, array input [, int flags])
4 * Function is implemented in ext/pcre/php_pcre.c
5 */
6 echo "*** Testing preg_grep() : error conditions ***\n";
7 // Zero arguments
8 echo "\n-- Testing preg_grep() function with Zero arguments --\n";
9 var_dump(preg_grep());
10 //Test preg_grep with one more than the expected number of arguments
11 echo "\n-- Testing preg_grep() function with more than expected no. of arguments --\n";
12 $regex = '/\d/';
13 $input = array(1, 2);
14 $flags = 0;
15 $extra_arg = 10;
16 var_dump(preg_grep($regex, $input, $flags, $extra_arg));
17 // Testing preg_grep withone less than the expected number of arguments
18 echo "\n-- Testing preg_grep() function with less than expected no. of arguments --\n";
19 $regex = 'string_val';
20 var_dump(preg_grep($regex));
21 echo "Done"