1--TEST--
2Test mb_substitute_character() function : basic functionality
3--EXTENSIONS--
4mbstring
5--FILE--
6<?php
7echo "*** Testing mb_substitute_character() : basic functionality ***\n";
8
9
10// Initialise all required variables
11var_dump( mb_substitute_character() );
12var_dump( mb_substitute_character(66) );
13var_dump( mb_substitute_character() );
14var_dump( mb_substitute_character(1234) );
15var_dump( mb_substitute_character() );
16var_dump( mb_substitute_character('none') );
17var_dump( mb_substitute_character() );
18// Check string case insensitivity
19var_dump( mb_substitute_character('LoNg') );
20var_dump( mb_substitute_character() );
21try {
22    var_dump( mb_substitute_character("b") );
23} catch (\ValueError $e) {
24    echo $e->getMessage() . \PHP_EOL;
25}
26
27?>
28--EXPECT--
29*** Testing mb_substitute_character() : basic functionality ***
30int(63)
31bool(true)
32int(66)
33bool(true)
34int(1234)
35bool(true)
36string(4) "none"
37bool(true)
38string(4) "long"
39mb_substitute_character(): Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint
40