diff options
author | Moriyoshi Koizumi <moriyoshi@php.net> | 2003-10-03 16:59:44 +0000 |
---|---|---|
committer | Moriyoshi Koizumi <moriyoshi@php.net> | 2003-10-03 16:59:44 +0000 |
commit | 7e9a54990ccb3b46a32d0e76bc034148b9bcaa3b (patch) | |
tree | bfed2e9d88db904d7ab4774d85c3881186220f29 /ext/ctype | |
parent | be5cbf999979abecf33187a04a72c87b08738cd6 (diff) | |
download | php-git-7e9a54990ccb3b46a32d0e76bc034148b9bcaa3b.tar.gz |
Add regression test for bug #25745
Diffstat (limited to 'ext/ctype')
-rw-r--r-- | ext/ctype/tests/bug25745.phpt | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/ctype/tests/bug25745.phpt b/ext/ctype/tests/bug25745.phpt new file mode 100644 index 0000000000..1d0ae0da7e --- /dev/null +++ b/ext/ctype/tests/bug25745.phpt @@ -0,0 +1,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 |