1--TEST--
2Test iconv_strrpos() function : error conditions - pass an unknown encoding
3--SKIPIF--
4<?php
5extension_loaded('iconv') or die('skip');
6function_exists('iconv_strrpos') or die("skip iconv_strrpos() is not available in this build");
7?>
8--FILE--
9<?php
10/* Prototype  : proto int iconv_strrpos(string haystack, string needle [, string charset])
11 * Description: Find position of last occurrence of a string within another
12 * Source code: ext/iconv/iconv.c
13 */
14
15/*
16 * Pass iconv_strrpos() an encoding that doesn't exist
17 */
18
19echo "*** Testing iconv_strrpos() : error conditions ***\n";
20
21$haystack = 'This is an English string. 0123456789.';
22$needle = '123';
23$offset = 5;
24$encoding = 'unknown-encoding';
25
26var_dump(iconv_strrpos($haystack, $needle , $encoding));
27
28echo "Done";
29?>
30--EXPECTF--
31*** Testing iconv_strrpos() : error conditions ***
32
33Notice: iconv_strrpos(): Wrong charset, conversion from `unknown-encoding' to `UCS-4LE' is not allowed in %s on line %d
34bool(false)
35Done