import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-strings / chunk_split_variation9.php
blob3db3b3046d9712588d05d22af8c3ee3a05cedc68
1 <?php
2 /* Prototype : string chunk_split(string $str [, int $chunklen [, string $ending]])
3 * Description: Returns split line
4 * Source code: ext/standard/string.c
5 * Alias to functions: none
6 */
8 /*
9 * passing different double quoted strings for 'ending' argument to chunk_split()
10 * here 'chunklen' is set to 6.5
13 echo "*** Testing chunk_split() : different strings for 'ending' ***\n";
15 //Initializing variables
16 $str = "This is to test chunk_split() with various ending string";
17 $chunklen = 6.5;
19 //different values for 'ending' argument
20 $values = array (
21 "", //empty
22 " ", //space
23 "a", //Single char
24 "ENDING", //regular string
25 "@#$%^", //Special chars
27 // white space chars
28 "\t",
29 "\n",
30 "\r",
31 "\r\n",
33 "\0", //Null char
34 "123", //Numeric
35 "(MSG)", //With ( and )
36 ")ending string(", //sentence as ending string
37 ")numbers 1234(",
38 ")speci@! ch@r$("
41 //loop through element of values for 'ending'
42 for($count = 0; $count < count($values); $count++) {
43 echo "-- Iteration $count --\n";
44 var_dump( chunk_split($str, $chunklen, $values[$count]) );
47 echo "Done"