1--TEST--
2Test mb_stripos() function : error conditions - Pass unknown encoding
3--EXTENSIONS--
4mbstring
5--FILE--
6<?php
7/*
8 * Pass an unknown encoding to mb_stripos() to test behaviour
9 */
10
11echo "*** Testing mb_stripos() : error conditions ***\n";
12$haystack = 'Hello, world';
13$needle = 'world';
14$offset = 2;
15$encoding = 'unknown-encoding';
16
17try {
18    var_dump( mb_stripos($haystack, $needle, $offset, $encoding) );
19} catch (\ValueError $e) {
20    echo $e->getMessage() . \PHP_EOL;
21}
22
23?>
24--EXPECT--
25*** Testing mb_stripos() : error conditions ***
26mb_stripos(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given
27