import zend standard tests
[hiphop-php.git] / hphp / test / zend / bad / ext-standard-strings / chunk_split_variation5.php
blob471b75b2430b99595b5c75bcfae61aa7a2cba0a1
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 * passsing different integer values for 'chunklen' argument to chunk_split()
10 * 'ending' is set to '||'
13 echo "*** Testing chunk_split() : different integer values for 'chunklen' ***\n";
15 //Initializing variables
16 $ending = "||";
17 $str = "This contains\tand special char & numbers 123.\nIt also checks for \0 char";
19 // different values for chunklen
20 $values = array (
21 0,
22 1,
23 -123, //negative integer
24 0234, //octal number
25 0x1A, //hexadecimal number
26 PHP_INT_MAX, //max positive integer number
27 PHP_INT_MAX * 3, //integer overflow
28 -PHP_INT_MAX - 1, //min negative integer
32 for($count = 0; $count < count($values); $count++) {
33 echo "-- Iteration $count --\n";
34 var_dump( chunk_split($str, $values[$count], $ending) );
37 echo "Done"