Return to chunk_split_basic.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / ext / standard / tests / strings |
1.1 misho 1: --TEST-- 2: Test chunk_split() function : basic functionality 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: * Testing chunk_split() for basic functionality by passing all possible 13: * arguments as well as with default arguments chunklen and ending 14: */ 15: 16: echo "*** Testing chunk_split() : basic functionality ***\n"; 17: 18: 19: // Initialise all required variables 20: $str = 'Testing'; 21: $chunklen = 2; 22: $ending = '##'; 23: 24: // Calling chunk_split() with all possible arguments 25: echo "-- Testing chunk_split() with all possible arguments --\n"; 26: var_dump( chunk_split($str, $chunklen, $ending) ); 27: 28: 29: // Calling chunk_split() with default ending string 30: echo "-- Testing chunk_split() with default ending string --\n"; 31: var_dump( chunk_split($str, $chunklen) ); 32: 33: 34: //Calling chunk_split() with default chunklen and ending string 35: echo "-- Testing chunk_split() with default chunklen and ending string --\n"; 36: var_dump( chunk_split($str) ); 37: 38: echo "Done" 39: ?> 40: --EXPECTF-- 41: *** Testing chunk_split() : basic functionality *** 42: -- Testing chunk_split() with all possible arguments -- 43: string(15) "Te##st##in##g##" 44: -- Testing chunk_split() with default ending string -- 45: string(15) "Te 46: st 47: in 48: g 49: " 50: -- Testing chunk_split() with default chunklen and ending string -- 51: string(9) "Testing 52: " 53: Done