1--TEST-- 2Test iconv_strlen() function : basic functionality 3--SKIPIF-- 4<?php 5extension_loaded('iconv') or die('skip'); 6function_exists('iconv_strlen') or die("skip iconv_strlen() is not available in this build"); 7?> 8--FILE-- 9<?php 10/* 11 * Test basic functionality of iconv_strlen() 12 */ 13 14echo "*** Testing iconv_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(iconv_strlen($string_ascii)); 22 23echo "\n-- Multibyte String --\n"; 24var_dump(iconv_strlen($string_mb, 'UTF-8')); 25?> 26--EXPECT-- 27*** Testing iconv_strlen() : basic functionality*** 28 29-- ASCII String -- 30int(7) 31 32-- Multibyte String -- 33int(21) 34