1--TEST--
2Test ctype_punct() function : usage variations - different punctuation
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7/*
8 * Pass strings containing different character types to ctype_punct() to test
9 * which are considered valid punctuation character only strings
10 */
11
12echo "*** Testing ctype_punct() : usage variations ***\n";
13
14$orig = setlocale(LC_CTYPE, "C");
15
16$values = array(
17/*1*/  "This string contains just letters and spaces", // Simple string
18       "but this one contains some numbers too 123+456 = 678", // Mixed string
19       "",
20       " ",
21/*5*/  "a",
22       "ABCXYZ",
23       "abcxyz",
24       "ABCXYZ123DEF456",
25       "abczyz123DEF456",
26/*10*/ "\r\n",
27       "123",
28       "03F", // hexadecimal 'digits'
29       ")speci@! ch@r$(",
30       '@!$*',
31/*15*/ 'ABC',
32       'abc',
33       'ABC123',
34       'abc123',
35       "abc123\n",
36/*20*/ 'abc 123',
37       '',
38       ' ',
39       base64_decode("w4DDoMOHw6fDiMOo"), // non-ascii characters
40       "!$%@\n",
41/*25*/ "\"?!\"",
42/*26*/ "|\ @~",
43);
44
45$iterator = 1;
46foreach($values as $value) {
47      echo "\n-- Iteration $iterator --\n";
48      var_dump( ctype_punct($value) );
49      $iterator++;
50};
51setlocale(LC_CTYPE, $orig);
52?>
53--EXPECT--
54*** Testing ctype_punct() : 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(false)
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(true)
97
98-- Iteration 15 --
99bool(false)
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(true)
130
131-- Iteration 26 --
132bool(false)
133