Annotation of embedaddon/php/ext/standard/tests/strings/strncasecmp_variation8.phpt, revision 1.1.1.1

1.1       misho       1: --TEST--
                      2: Test strncasecmp() function: usage variations - single quoted strings
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : int strncasecmp ( string $str1, string $str2, int $len ); 
                      6:  * Description: Binary safe case-insensitive string comparison of the first n characters
                      7:  * Source code: Zend/zend_builtin_functions.c
                      8: */
                      9: 
                     10: /* Test strncasecmp() function with various single quoted strings for 'str1', 'str2' */
                     11: 
                     12: echo "*** Test strncasecmp() function: with single quoted strings ***\n";
                     13: $strings = array(
                     14:   'Hello, World',
                     15:   'hello, world',
                     16:   'HELLO, WORLD',
                     17:   'Hello, World\n'
                     18: );
                     19: /* loop through to compare each string with the other string */
                     20: $count = 1;
                     21: for($index1 = 0; $index1 < count($strings); $index1++) {
                     22:   echo "-- Iteration $count --\n";
                     23:   for($index2 = 0; $index2 < count($strings); $index2++) {
                     24:     var_dump( strncasecmp( $strings[$index1], $strings[$index2], (strlen($strings[$index1]) + 1) ) );
                     25:   }
                     26:   $count ++;
                     27: }
                     28: echo "*** Done ***\n";
                     29: ?>
                     30: --EXPECTREGEX--
                     31: \*\*\* Test strncasecmp\(\) function: with single quoted strings \*\*\*
                     32: -- Iteration 1 --
                     33: int\(0\)
                     34: int\(0\)
                     35: int\(0\)
                     36: int\(-[1-9][0-9]*\)
                     37: -- Iteration 2 --
                     38: int\(0\)
                     39: int\(0\)
                     40: int\(0\)
                     41: int\(-[1-9][0-9]*\)
                     42: -- Iteration 3 --
                     43: int\(0\)
                     44: int\(0\)
                     45: int\(0\)
                     46: int\(-[1-9][0-9]*\)
                     47: -- Iteration 4 --
                     48: int\([1-9][0-9]*\)
                     49: int\([1-9][0-9]*\)
                     50: int\([1-9][0-9]*\)
                     51: int\(0\)
                     52: \*\*\* Done \*\*\*

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