1--TEST-- 2Test mb_internal_encoding() function : error conditions - pass an unknown encoding 3--SKIPIF-- 4<?php 5extension_loaded('mbstring') or die('skip'); 6function_exists('mb_internal_encoding') or die("skip mb_internal_encoding() is not available in this build"); 7?> 8--FILE-- 9<?php 10/* 11 * Pass mb_internal_encoding an unknown encoding 12 */ 13 14echo "*** Testing mb_internal_encoding() : error conditions ***\n"; 15 16try { 17 var_dump(mb_internal_encoding('unknown-encoding')); 18} catch (\ValueError $e) { 19 echo $e->getMessage() . \PHP_EOL; 20} 21 22?> 23--EXPECT-- 24*** Testing mb_internal_encoding() : error conditions *** 25mb_internal_encoding(): Argument #1 ($encoding) must be a valid encoding, "unknown-encoding" given 26