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