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

1.1       misho       1: --TEST--
                      2: Test chunk_split() function : usage variations - default 'chunklen' with long string as 'str'argument
                      3: --FILE--
                      4: <?php
                      5: /* Prototype  : string chunk_split(string $str [, int $chunklen [, string $ending]])
                      6:  * Description: Returns split line
                      7:  * Source code: ext/standard/string.c
                      8:  * Alias to functions: 
                      9: */
                     10: 
                     11: /*
                     12: * passing long string as 'str' and testing default value of chunklen which is 76
                     13: */
                     14: 
                     15: echo "*** Testing chunk_split() : default 'chunklen' with long string 'str' ***\n";
                     16: 
                     17: //Initializing variables
                     18: $values = array (
                     19:   "123456789012345678901234567890123456789012345678901234567890123456789012345678901",
                     20:   "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901"
                     21: );
                     22: 
                     23: //loop through each element of values for 'str' and default value of 'chunklen'
                     24: for($count = 0; $count < count($values); $count++) {
                     25:   echo "-- Iteration $count --\n";
                     26:   var_dump( chunk_split($values[$count]) );
                     27: }
                     28: 
                     29: echo "Done"
                     30: ?>
                     31: --EXPECTF--
                     32: *** Testing chunk_split() : default 'chunklen' with long string 'str' ***
                     33: -- Iteration 0 --
                     34: string(85) "1234567890123456789012345678901234567890123456789012345678901234567890123456
                     35: 78901
                     36: "
                     37: -- Iteration 1 --
                     38: string(217) "1234567890123456789012345678901234567890123456789012345678901234567890123456
                     39: 7890123456789012345678901234567890123456789012345678901234567890123456789012
                     40: 34567890123456789012345678901234567890123456789012345678901
                     41: "
                     42: Done

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