1--TEST-- 2Test mb_strlen() function : error conditions - pass an unknown encoding 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/* Prototype : int mb_strlen(string $str [, string $encoding]) 11 * Description: Get character numbers of a string 12 * Source code: ext/mbstring/mbstring.c 13 */ 14 15/* 16 * Test mb_strlen when passed an unknown encoding 17 */ 18 19echo "*** Testing mb_strlen() : error ***\n"; 20 21$string = 'abcdef'; 22 23$encoding = 'unknown-encoding'; 24 25var_dump(mb_strlen($string, $encoding)); 26 27echo "Done"; 28?> 29--EXPECTF-- 30*** Testing mb_strlen() : error *** 31 32Warning: mb_strlen(): Unknown encoding "unknown-encoding" in %s on line %d 33bool(false) 34Done 35