summaryrefslogtreecommitdiff
path: root/ext/ctype/tests/bug25745.phpt
blob: 1d0ae0da7e3f84cbf484a8843a3d02dc6f966189 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
Bug #25745 (ctype functions fail with non-ascii characters)
--FILE--
<?php
$funcs = array(
	"ctype_alnum", "ctype_alpha", "ctype_cntrl", "ctype_digit",
	"ctype_graph", "ctype_lower", "ctype_print", "ctype_punct",
	"ctype_space", "ctype_upper", "ctype_xdigit"
);

foreach ($funcs as $ctype_func) {
	for ($i = 0; $i < 256; $i++) {
		$a = $ctype_func($i);
		$b = $ctype_func(chr($i));
		if ($a != $b) {
			echo "broken... $ctype_func($i) = $a, $ctype_func(chr($i)) = $b\n";
			exit;
		}
	}
}
echo "ok\n";
?>
--EXPECT--
ok