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/*
8 * Pass octal and hexadecimal values to ctype_alpha() to test behaviour
9 */
10
11echo "*** Testing ctype_alpha() : usage variations ***\n";
12
13$orig = setlocale(LC_CTYPE, "C");
14
15$octal_values = array (0101, 0102, 0103, 0104);
16$hex_values = array   (0x41, 0x42, 0x43, 0x44);
17
18echo "\n-- Octal Values --\n";
19$iterator = 1;
20foreach($octal_values as $c) {
21    echo "-- Iteration $iterator --\n";
22    var_dump(ctype_alpha($c));
23    $iterator++;
24}
25
26echo "\n-- Hexadecimal Values --\n";
27$iterator = 1;
28foreach($hex_values as $c) {
29    echo "-- Iteration $iterator --\n";
30    var_dump(ctype_alpha($c));
31    $iterator++;
32}
33
34setlocale(LC_CTYPE, $orig);
35?>
36--EXPECT--
37*** Testing ctype_alpha() : usage variations ***
38
39-- Octal Values --
40-- Iteration 1 --
41bool(true)
42-- Iteration 2 --
43bool(true)
44-- Iteration 3 --
45bool(true)
46-- Iteration 4 --
47bool(true)
48
49-- Hexadecimal Values --
50-- Iteration 1 --
51bool(true)
52-- Iteration 2 --
53bool(true)
54-- Iteration 3 --
55bool(true)
56-- Iteration 4 --
57bool(true)
58