1--TEST--
2Test iconv_strrpos() function : basic functionality
3--EXTENSIONS--
4iconv
5--INI--
6error_reporting=E_ALL & ~E_DEPRECATED
7--FILE--
8<?php
9/*
10 * Test basic functionality of iconv_strrpos()
11 */
12
13echo "*** Testing iconv_strrpos() : basic ***\n";
14
15iconv_set_encoding("internal_encoding", "UTF-8");
16
17$string_ascii = 'This is an English string. 0123456789.';
18//Japanese string in UTF-8
19$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');
20
21echo "\n-- ASCII string 1 --\n";
22var_dump(iconv_strrpos($string_ascii, 'is', 'ISO-8859-1'));
23
24echo "\n-- ASCII string 2 --\n";
25var_dump(iconv_strrpos($string_ascii, 'hello, world'));
26
27echo "\n-- Multibyte string 1 --\n";
28$needle1 = base64_decode('44CC');
29var_dump(iconv_strrpos($string_mb, $needle1));
30
31echo "\n-- Multibyte string 2 --\n";
32$needle2 = base64_decode('44GT44KT44Gr44Gh44Gv44CB5LiW55WM');
33var_dump(iconv_strrpos($string_mb, $needle2));
34
35echo "Done";
36?>
37--EXPECT--
38*** Testing iconv_strrpos() : basic ***
39
40-- ASCII string 1 --
41int(15)
42
43-- ASCII string 2 --
44bool(false)
45
46-- Multibyte string 1 --
47int(20)
48
49-- Multibyte string 2 --
50bool(false)
51Done
52