summaryrefslogtreecommitdiff
path: root/ext/standard/tests/strings/chunk_split_variation13.phpt
blob: b797ff45d2cd8bfb3e28c3a4005478dcb459707b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--TEST--
Test chunk_split() function : usage variations - default 'chunklen' with long string as 'str'argument
--FILE--
<?php
/*
* passing long string as 'str' and testing default value of chunklen which is 76
*/

echo "*** Testing chunk_split() : default 'chunklen' with long string 'str' ***\n";

//Initializing variables
$values = array (
  "123456789012345678901234567890123456789012345678901234567890123456789012345678901",
  "1234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901"
);

//loop through each element of values for 'str' and default value of 'chunklen'
for($count = 0; $count < count($values); $count++) {
  echo "-- Iteration $count --\n";
  var_dump( chunk_split($values[$count]) );
}

echo "Done"
?>
--EXPECT--
*** Testing chunk_split() : default 'chunklen' with long string 'str' ***
-- Iteration 0 --
string(85) "1234567890123456789012345678901234567890123456789012345678901234567890123456
78901
"
-- Iteration 1 --
string(217) "1234567890123456789012345678901234567890123456789012345678901234567890123456
7890123456789012345678901234567890123456789012345678901234567890123456789012
34567890123456789012345678901234567890123456789012345678901
"
Done