1--TEST-- 2Test mb_strtoupper() function : error conditions - pass an unknown encoding 3--EXTENSIONS-- 4mbstring 5--FILE-- 6<?php 7/* 8 * Pass an unknown encoding as $encoding argument to check behaviour of mbstrtoupper() 9 */ 10 11echo "*** Testing mb_strtoupper() : error conditions ***\n"; 12 13$sourcestring = 'hello, world'; 14$encoding = 'unknown-encoding'; 15 16try { 17 var_dump( mb_strtoupper($sourcestring, $encoding) ); 18} catch (\ValueError $e) { 19 echo $e->getMessage() . \PHP_EOL; 20} 21 22?> 23--EXPECT-- 24*** Testing mb_strtoupper() : error conditions *** 25mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "unknown-encoding" given 26