1--TEST--
2Test mb_strlen() function : basic functionality
3--SKIPIF--
4<?php
5extension_loaded('mbstring') or die('skip');
6function_exists('mb_strlen') or die("skip mb_strlen() is not available in this build");
7?>
8--FILE--
9<?php
10/*
11 * Test basic functionality of mb_strlen()
12 */
13
14echo "*** Testing mb_strlen() : basic functionality***\n";
15
16$string_ascii = 'abc def';
17//Japanese string in UTF-8
18$string_mb = base64_decode('5pel5pys6Kqe44OG44Kt44K544OI44Gn44GZ44CCMDEyMzTvvJXvvJbvvJfvvJjvvJnjgII=');
19
20echo "\n-- ASCII String --\n";
21var_dump(mb_strlen($string_ascii));
22
23echo "\n-- Multibyte String --\n";
24var_dump(mb_strlen($string_mb, 'UTF-8'));
25
26echo "\nDone";
27?>
28--EXPECT--
29*** Testing mb_strlen() : basic functionality***
30
31-- ASCII String --
32int(7)
33
34-- Multibyte String --
35int(21)
36
37Done
38