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