Annotation of embedaddon/php/ext/ctype/tests/ctype_punct_variation4.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test ctype_punct() function : usage variations - Octal and Hexadecimal values
3: --SKIPIF--
4: <?php require_once('skipif.inc'); ?>
5: --FILE--
6: <?php
7: /* Prototype : bool ctype_punct(mixed $c)
8: * Description: Checks for any printable character which is not whitespace
9: * or an alphanumeric character
10: * Source code: ext/ctype/ctype.c
11: */
12:
13: /*
14: * Pass different octal and hexadecimal values to ctype_punct() to test behaviour
15: */
16:
17: echo "*** Testing ctype_punct() : usage variations ***\n";
18:
19: $orig = setlocale(LC_CTYPE, "C");
20:
21: $octal_values = array(041, 042, 043, 044);
22: $hex_values = array(0x21, 0x22, 0x23, 0x24);
23:
24: echo "\n-- Octal Values --\n";
25: $iterator = 1;
26: foreach($octal_values as $c) {
27: echo "-- Iteration $iterator --\n";
28: var_dump(ctype_punct($c));
29: $iterator++;
30: }
31:
32: echo "\n-- Hexadecimal Values --\n";
33: $iterator = 1;
34: foreach($hex_values as $c) {
35: echo "-- Iteration $iterator --\n";
36: var_dump(ctype_punct($c));
37: $iterator++;
38: }
39:
40: setlocale(LC_CTYPE, $orig);
41: ?>
42: ===DONE===
43: --EXPECTF--
44: *** Testing ctype_punct() : usage variations ***
45:
46: -- Octal Values --
47: -- Iteration 1 --
48: bool(true)
49: -- Iteration 2 --
50: bool(true)
51: -- Iteration 3 --
52: bool(true)
53: -- Iteration 4 --
54: bool(true)
55:
56: -- Hexadecimal Values --
57: -- Iteration 1 --
58: bool(true)
59: -- Iteration 2 --
60: bool(true)
61: -- Iteration 3 --
62: bool(true)
63: -- Iteration 4 --
64: bool(true)
65: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>