1--TEST--
2Test ctype_alpha() function : usage variations - Octal and hexadecimal values
3--SKIPIF--
4<?php require_once('skipif.inc'); ?>
5--FILE--
6<?php
7/* Prototype  : bool ctype_alpha(mixed $c)
8 * Description: Checks for alphabetic character(s)
9 * Source code: ext/ctype/ctype.c
10 */
11
12/*
13 * Pass octal and hexadecimal values to ctype_alpha() to test behaviour
14 */
15
16echo "*** Testing ctype_alpha() : usage variations ***\n";
17
18$orig = setlocale(LC_CTYPE, "C");
19
20$octal_values = array (0101, 0102, 0103, 0104);
21$hex_values = array   (0x41, 0x42, 0x43, 0x44);
22
23echo "\n-- Octal Values --\n";
24$iterator = 1;
25foreach($octal_values as $c) {
26	echo "-- Iteration $iterator --\n";
27	var_dump(ctype_alpha($c));
28	$iterator++;
29}
30
31echo "\n-- Hexadecimal Values --\n";
32$iterator = 1;
33foreach($hex_values as $c) {
34	echo "-- Iteration $iterator --\n";
35	var_dump(ctype_alpha($c));
36	$iterator++;
37}
38
39setlocale(LC_CTYPE, $orig);
40?>
41===DONE===
42--EXPECT--
43*** Testing ctype_alpha() : usage variations ***
44
45-- Octal Values --
46-- Iteration 1 --
47bool(true)
48-- Iteration 2 --
49bool(true)
50-- Iteration 3 --
51bool(true)
52-- Iteration 4 --
53bool(true)
54
55-- Hexadecimal Values --
56-- Iteration 1 --
57bool(true)
58-- Iteration 2 --
59bool(true)
60-- Iteration 3 --
61bool(true)
62-- Iteration 4 --
63bool(true)
64===DONE===
65