1--TEST--
2Test chunk_split() function : error conditions
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: none
9*/
10
11/*
12* Testing error conditions of chunk_split() with zero arguments
13* and for more than expected number of arguments
14*/
15
16echo "*** Testing chunk_split() : error conditions ***\n";
17
18// Zero arguments
19echo "-- Testing chunk_split() function with Zero arguments --";
20var_dump( chunk_split() );
21
22// With one more than the expected number of arguments
23$str = 'Testing chunk_split';
24$chunklen = 5;
25$ending = '***';
26$extra_arg = 10;
27echo "-- Testing chunk_split() function with more than expected no. of arguments --";
28var_dump( chunk_split($str, $chunklen, $ending, $extra_arg) );
29
30echo "Done"
31?>
32--EXPECTF--
33*** Testing chunk_split() : error conditions ***
34-- Testing chunk_split() function with Zero arguments --
35Warning: chunk_split() expects at least 1 parameter, 0 given in %s on line %d
36NULL
37-- Testing chunk_split() function with more than expected no. of arguments --
38Warning: chunk_split() expects at most 3 parameters, 4 given in %s on line %d
39NULL
40Done
41