Annotation of embedaddon/php/ext/ctype/tests/ctype_digit_variation2.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test ctype_digit() function : usage variations - different integers
3: --SKIPIF--
4: <?php require_once('skipif.inc'); ?>
5: --FILE--
6: <?php
7: /* Prototype : bool ctype_digit(mixed $c)
8: * Description: Checks for numeric character(s)
9: * Source code: ext/ctype/ctype.c
10: */
11:
12: /*
13: * Pass different integers to ctype_digit() to test which character codes are considered
14: * valid decimal digits
15: */
16:
17: echo "*** Testing ctype_digit() : usage variations ***\n";
18:
19: $orig = setlocale(LC_CTYPE, "C");
20:
21: for ($i = 0; $i < 256; $i++) {
22: if (ctype_digit($i)) {
23: echo "character code $i is a numeric digit\n";
24: }
25: }
26:
27: setlocale(LC_CTYPE, $orig);
28: ?>
29: ===DONE===
30: --EXPECTF--
31: *** Testing ctype_digit() : usage variations ***
32: character code 48 is a numeric digit
33: character code 49 is a numeric digit
34: character code 50 is a numeric digit
35: character code 51 is a numeric digit
36: character code 52 is a numeric digit
37: character code 53 is a numeric digit
38: character code 54 is a numeric digit
39: character code 55 is a numeric digit
40: character code 56 is a numeric digit
41: character code 57 is a numeric digit
42: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>