1--TEST--
2Test 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
15echo "*** 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'
24for($count = 0; $count < count($values); $count++) {
25  echo "-- Iteration $count --\n";
26  var_dump( chunk_split($values[$count]) );
27}
28
29echo "Done"
30?>
31--EXPECT--
32*** Testing chunk_split() : default 'chunklen' with long string 'str' ***
33-- Iteration 0 --
34string(85) "1234567890123456789012345678901234567890123456789012345678901234567890123456
3578901
36"
37-- Iteration 1 --
38string(217) "1234567890123456789012345678901234567890123456789012345678901234567890123456
397890123456789012345678901234567890123456789012345678901234567890123456789012
4034567890123456789012345678901234567890123456789012345678901
41"
42Done
43