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