1--TEST-- 2Test mb_strtoupper() function : basic functionality 3--SKIPIF-- 4<?php 5extension_loaded('mbstring') or die('skip'); 6function_exists('mb_strtoupper') or die("skip mb_strtoupper() is not available in this build"); 7?> 8--FILE-- 9<?php 10/* Prototype : string mb_strtoupper(string $sourcestring [, string $encoding] 11 * Description: Returns a uppercased version of $sourcestring 12 * Source code: ext/mbstring/mbstring.c 13 */ 14 15/* 16 * Test basic functionality of mb_strtoupper 17 */ 18 19echo "*** Testing mb_strtoupper() : basic functionality ***\n"; 20 21mb_internal_encoding('utf-8'); 22$ascii_lower = 'abcdefghijklmnopqrstuvwxyz'; 23$ascii_upper = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'; 24$greek_lower = base64_decode('zrHOss6zzrTOtc62zrfOuM65zrrOu868zr3Ovs6/z4DPgc+Dz4TPhc+Gz4fPiM+J'); 25$greek_upper = base64_decode('zpHOks6TzpTOlc6WzpfOmM6ZzprOm86czp3Ons6fzqDOoc6jzqTOpc6mzqfOqM6p'); 26 27echo "\n-- ASCII String --\n"; 28$ascii = mb_strtoupper($ascii_lower); 29var_dump(base64_encode($ascii)); 30 31if($ascii == $ascii_upper) { 32 echo "Correctly converted\n"; 33} else { 34 echo "Incorrectly converted\n"; 35} 36 37echo "\n-- Multibyte String --\n"; 38$mb = mb_strtoupper($greek_lower, 'UTF-8'); 39var_dump(base64_encode($mb)); 40 41if ($mb == $greek_upper) { 42 echo "Correctly converted\n"; 43} else { 44 echo "Incorreclty converted\n"; 45} 46 47echo "Done"; 48?> 49--EXPECT-- 50*** Testing mb_strtoupper() : basic functionality *** 51 52-- ASCII String -- 53string(36) "QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVo=" 54Correctly converted 55 56-- Multibyte String -- 57string(64) "zpHOks6TzpTOlc6WzpfOmM6ZzprOm86czp3Ons6fzqDOoc6jzqTOpc6mzqfOqM6p" 58Correctly converted 59Done 60