1--TEST-- 2Test mb_strrichr() function : error conditions 3--SKIPIF-- 4<?php 5extension_loaded('mbstring') or die('skip'); 6function_exists('mb_strrichr') or die("skip mb_strrichr() is not available in this build"); 7?> 8--FILE-- 9<?php 10/* Prototype : string mb_strrichr(string haystack, string needle[, bool part[, string encoding]]) 11 * Description: Finds the last occurrence of a character in a string within another, case insensitive 12 * Source code: ext/mbstring/mbstring.c 13 * Alias to functions: 14 */ 15 16echo "*** Testing mb_strrichr() : error conditions ***\n"; 17 18 19echo "\n-- Testing mb_strrichr() with unknown encoding --\n"; 20$haystack = 'Hello, world'; 21$needle = 'world'; 22$encoding = 'unknown-encoding'; 23$part = true; 24var_dump( mb_strrichr($haystack, $needle, $part, $encoding) ); 25 26?> 27===DONE=== 28--EXPECTF-- 29*** Testing mb_strrichr() : error conditions *** 30 31-- Testing mb_strrichr() with unknown encoding -- 32 33Warning: mb_strrichr(): Unknown encoding "unknown-encoding" in %s on line %d 34bool(false) 35===DONE=== 36