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