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

1.1       misho       1: --TEST--
                      2: Test ctype_space() function : usage variations - octal and hexadecimal values
                      3: --SKIPIF--
                      4: <?php require_once('skipif.inc'); ?>
                      5: --FILE--
                      6: <?php
                      7: /* Prototype  : bool ctype_space(mixed $c)
                      8:  * Description: Checks for whitespace character(s)
                      9:  * Source code: ext/ctype/ctype.c
                     10:  */
                     11: 
                     12: /*
                     13:  * Pass octal and hexadecimal values as $c to ctype_space() to test behaviour
                     14:  */
                     15: 
                     16: echo "*** Testing ctype_space() : usage variations ***\n";
                     17: 
                     18: $orig = setlocale(LC_CTYPE, "C");
                     19: 
                     20: $octal_values = array (011, 012, 013, 014, 015, 040);
                     21: $hex_values   = array (0x9, 0xA, 0xB, 0xC, 0xD, 0x20);
                     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_space($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_space($c));
                     36:        $iterator++;
                     37: }
                     38: setlocale(LC_CTYPE, $orig);
                     39: ?>
                     40: ===DONE===
                     41: --EXPECTF--
                     42: *** Testing ctype_space() : usage variations ***
                     43: 
                     44: -- Octal Values --
                     45: -- Iteration 1 --
                     46: bool(true)
                     47: -- Iteration 2 --
                     48: bool(true)
                     49: -- Iteration 3 --
                     50: bool(true)
                     51: -- Iteration 4 --
                     52: bool(true)
                     53: -- Iteration 5 --
                     54: bool(true)
                     55: -- Iteration 6 --
                     56: bool(true)
                     57: 
                     58: -- Hexadecimal Values --
                     59: -- Iteration 1 --
                     60: bool(true)
                     61: -- Iteration 2 --
                     62: bool(true)
                     63: -- Iteration 3 --
                     64: bool(true)
                     65: -- Iteration 4 --
                     66: bool(true)
                     67: -- Iteration 5 --
                     68: bool(true)
                     69: -- Iteration 6 --
                     70: bool(true)
                     71: ===DONE===

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