1--TEST--
2Test mb_regex_encoding() function : error conditions - pass incorrect number of args
3--SKIPIF--
4<?php
5extension_loaded('mbstring') or die('skip');
6function_exists('mb_regex_encoding') or die("skip mb_regex_encoding() is not available in this build");
7?>
8--FILE--
9<?php
10/* Prototype  : string mb_regex_encoding([string $encoding])
11 * Description: Returns the current encoding for regex as a string.
12 * Source code: ext/mbstring/php_mbregex.c
13 */
14
15/*
16 * Test mb_regex_encoding with one more than expected number of arguments
17 */
18
19echo "*** Testing mb_regex_encoding() : error conditions ***\n";
20
21
22echo "\n-- Testing mb_regex_encoding() function with more than expected no. of arguments --\n";
23$encoding = 'string_val';
24$extra_arg = 10;
25var_dump( mb_regex_encoding($encoding, $extra_arg) );
26
27echo "Done";
28?>
29--EXPECTF--
30*** Testing mb_regex_encoding() : error conditions ***
31
32-- Testing mb_regex_encoding() function with more than expected no. of arguments --
33
34Warning: mb_regex_encoding() expects at most 1 parameter, 2 given in %s on line %d
35NULL
36Done
37