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