Annotation of embedaddon/php/ext/ctype/tests/ctype_alpha_variation4.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test 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: 
                     16: echo "*** 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: 
                     23: echo "\n-- Octal Values --\n";
                     24: $iterator = 1;
                     25: foreach($octal_values as $c) {
                     26:        echo "-- Iteration $iterator --\n";
                     27:        var_dump(ctype_alpha($c));
                     28:        $iterator++;
                     29: }
                     30: 
                     31: echo "\n-- Hexadecimal Values --\n";
                     32: $iterator = 1;
                     33: foreach($hex_values as $c) {
                     34:        echo "-- Iteration $iterator --\n";
                     35:        var_dump(ctype_alpha($c));
                     36:        $iterator++;
                     37: }
                     38: 
                     39: setlocale(LC_CTYPE, $orig);
                     40: ?>
                     41: ===DONE===
                     42: --EXPECTF--
                     43: *** Testing ctype_alpha() : usage variations ***
                     44: 
                     45: -- Octal Values --
                     46: -- Iteration 1 --
                     47: bool(true)
                     48: -- Iteration 2 --
                     49: bool(true)
                     50: -- Iteration 3 --
                     51: bool(true)
                     52: -- Iteration 4 --
                     53: bool(true)
                     54: 
                     55: -- Hexadecimal Values --
                     56: -- Iteration 1 --
                     57: bool(true)
                     58: -- Iteration 2 --
                     59: bool(true)
                     60: -- Iteration 3 --
                     61: bool(true)
                     62: -- Iteration 4 --
                     63: bool(true)
                     64: ===DONE===

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>