import random crap zend files
[hiphop-php.git] / hphp / test / zend / good / ext-ctype / ctype_xdigit_variation3.php
blob68ac70a10144806bcb5b1536dcdfa0c19102a210
1 <?php
2 /* Prototype : bool ctype_xdigit(mixed $c)
3 * Description: Checks for character(s) representing a hexadecimal digit
4 * Source code: ext/ctype/ctype.c
5 */
7 /*
8 * Pass strings containing different character types to ctype_xdigit() to test
9 * which are considered valid hexadecimal 'digit' only strings
12 echo "*** Testing ctype_xdigit() : usage variations ***\n";
14 $orig = setlocale(LC_CTYPE, "C");
16 $values = array(
17 /*1*/ "This string contains just letters and spaces", // Simple string
18 "but this one contains some numbers too 123+456 = 678", // Mixed string
19 "",
20 " ",
21 /*5*/ "a",
22 "ABCXYZ",
23 "abcxyz",
24 "ABCXYZ123DEF456",
25 "abczyz123DEF456",
26 /*10*/ "\r\n",
27 "123",
28 "03F", // hexadecimal 'digits'
29 ")speci@! ch@r$(",
30 '@!$*',
31 /*15*/ 'ABC',
32 'abc',
33 'ABC123',
34 'abc123',
35 'abc123\n',
36 /*20*/ 'abc 123',
37 '',
38 ' ',
39 base64_decode("w4DDoMOHw6fDiMOo"), // non-ascii characters
40 'ABCdef07',
41 "56ea\tFB",
42 "0x2A"
45 $iterator = 1;
46 foreach($values as $value) {
47 echo "\n-- Iteration $iterator --\n";
48 var_dump( ctype_xdigit($value) );
49 $iterator++;
52 setlocale(LC_CTYPE, $orig);
54 ===DONE===