1--TEST--
2Test vprintf() function : error conditions
3--FILE--
4<?php
5/* Prototype  : int vprintf(string $format , array $args)
6 * Description: Output a formatted string
7 * Source code: ext/standard/formatted_print.c
8 */
9
10echo "*** Testing vprintf() : error conditions ***\n";
11
12// initialising the required variables
13$format = "%s";
14$args = array("hello");
15$extra_arg = "extra arg";
16
17// Zero arguments
18echo "\n-- Testing vprintf() function with Zero arguments --\n";
19var_dump( vprintf() );
20
21echo "\n-- Testing vprintf() function with less than expected no. of arguments --\n";
22var_dump( vprintf($format) );
23
24echo "\n-- testing vprintf() function with more than expected no. of arguments --\n";
25var_dump( vprintf($format, $args, $extra_arg) );
26
27?>
28===DONE===
29--EXPECTF--
30*** Testing vprintf() : error conditions ***
31
32-- Testing vprintf() function with Zero arguments --
33
34Warning: vprintf() expects at least 1 parameter, 0 given in %s on line %d
35bool(false)
36
37-- Testing vprintf() function with less than expected no. of arguments --
38
39Warning: Wrong parameter count for vprintf() in %s on line %d
40bool(false)
41
42-- testing vprintf() function with more than expected no. of arguments --
43
44Warning: Wrong parameter count for vprintf() in %s on line %d
45bool(false)
46===DONE===
47