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

1.1       misho       1: --TEST--
                      2: Test strncasecmp() function: usage variations - various lengths
                      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() with various lengths */
                     11: 
                     12: echo "*** Test strncasecmp() function: with different lengths ***\n";
                     13: /* definitions of required variables */
                     14: $str1 = "Hello, World\n";
                     15: $str2 = "Hello, world\n";
                     16: 
                     17: /* loop through to compare the strings, for various length values */
                     18: for($len = strlen($str1); $len >= 0; $len--) {
                     19:   var_dump( strncasecmp($str1, $str2, $len) );
                     20: }
                     21: echo "*** Done ***\n";
                     22: ?>
                     23: --EXPECTF--    
                     24: *** Test strncasecmp() function: with different lengths ***
                     25: int(0)
                     26: int(0)
                     27: int(0)
                     28: int(0)
                     29: int(0)
                     30: int(0)
                     31: int(0)
                     32: int(0)
                     33: int(0)
                     34: int(0)
                     35: int(0)
                     36: int(0)
                     37: int(0)
                     38: int(0)
                     39: *** Done ***

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