1--TEST--
2Test ctype_upper() function : usage variations - different strings
3--EXTENSIONS--
4ctype
5--FILE--
6<?php
7/*
8 * Pass strings containing different character types to ctype_upper() to test
9 * which are considered valid uppercase character only strings
10 */
11
12echo "*** Testing ctype_upper() : usage variations ***\n";
13$orig = setlocale(LC_CTYPE, "C");
14
15$values = array(
16/*1*/  "This string contains just letters and spaces", // Simple string
17       "but this one contains some numbers too 123+456 = 678", // Mixed string
18       "",
19       " ",
20/*5*/  "a",
21       "ABCXYZ",
22       "abcxyz",
23       "ABCXYZ123DEF456",
24       "abczyz123DEF456",
25/*10*/ "\r\n",
26       "123",
27       "03F", // hexadecimal 'digits'
28       ")speci@! ch@r$(",
29       '@!$*',
30/*15*/ 'ABC',
31       'abc',
32       'ABC123',
33       'abc123',
34       'abc123\n',
35/*20*/ 'abc 123',
36       '',
37       ' ',
38       base64_decode("w4DDoMOHw6fDiMOo"), // non-ascii characters
39       "abcXYZ",
40/*25*/ "ABC XYZ",
41/*26*/ "ABC+EFG*XYZ",
42);
43
44$iterator = 1;
45foreach($values as $value) {
46      echo "\n-- Iteration $iterator --\n";
47      var_dump( ctype_upper($value) );
48      $iterator++;
49};
50
51setlocale(LC_CTYPE, $orig);
52?>
53--EXPECT--
54*** Testing ctype_upper() : usage variations ***
55
56-- Iteration 1 --
57bool(false)
58
59-- Iteration 2 --
60bool(false)
61
62-- Iteration 3 --
63bool(false)
64
65-- Iteration 4 --
66bool(false)
67
68-- Iteration 5 --
69bool(false)
70
71-- Iteration 6 --
72bool(true)
73
74-- Iteration 7 --
75bool(false)
76
77-- Iteration 8 --
78bool(false)
79
80-- Iteration 9 --
81bool(false)
82
83-- Iteration 10 --
84bool(false)
85
86-- Iteration 11 --
87bool(false)
88
89-- Iteration 12 --
90bool(false)
91
92-- Iteration 13 --
93bool(false)
94
95-- Iteration 14 --
96bool(false)
97
98-- Iteration 15 --
99bool(true)
100
101-- Iteration 16 --
102bool(false)
103
104-- Iteration 17 --
105bool(false)
106
107-- Iteration 18 --
108bool(false)
109
110-- Iteration 19 --
111bool(false)
112
113-- Iteration 20 --
114bool(false)
115
116-- Iteration 21 --
117bool(false)
118
119-- Iteration 22 --
120bool(false)
121
122-- Iteration 23 --
123bool(false)
124
125-- Iteration 24 --
126bool(false)
127
128-- Iteration 25 --
129bool(false)
130
131-- Iteration 26 --
132bool(false)
133