xref: /PHP-5.5/ext/ctype/tests/001.phpt (revision 80e39119)
1--TEST--
2ctype on integers
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7  setlocale(LC_ALL,"C");
8
9  function ctype_test_001($function) {
10    $n=0;
11    for($a=0;$a<256;$a++) {
12	    if($function($a)) $n++;
13    }
14	  echo "$function $n\n";
15  }
16ctype_test_001("ctype_lower");
17ctype_test_001("ctype_upper");
18ctype_test_001("ctype_alpha");
19ctype_test_001("ctype_digit");
20ctype_test_001("ctype_alnum");
21ctype_test_001("ctype_cntrl");
22ctype_test_001("ctype_graph");
23ctype_test_001("ctype_print");
24ctype_test_001("ctype_punct");
25ctype_test_001("ctype_space");
26ctype_test_001("ctype_xdigit");
27?>
28--EXPECT--
29ctype_lower 26
30ctype_upper 26
31ctype_alpha 52
32ctype_digit 10
33ctype_alnum 62
34ctype_cntrl 33
35ctype_graph 94
36ctype_print 95
37ctype_punct 32
38ctype_space 6
39ctype_xdigit 22
40