1--TEST--
2Test vfprintf() function : error conditions (more than expected arguments)
3--CREDITS--
4Felix De Vliegher <felix.devliegher@gmail.com>
5--INI--
6precision=14
7--FILE--
8<?php
9/* Prototype  : int vfprintf(resource stream, string format, array args)
10 * Description: Output a formatted string into a stream
11 * Source code: ext/standard/formatted_print.c
12 * Alias to functions:
13 */
14
15// Open handle
16$file = 'vfprintf_test.txt';
17$fp = fopen( $file, "a+" );
18
19echo "\n-- Testing vfprintf() function with more than expected no. of arguments --\n";
20$format = 'string_val';
21$args = array( 1, 2 );
22$extra_arg = 10;
23var_dump( vfprintf( $fp, $format, $args, $extra_arg ) );
24var_dump( vfprintf( $fp, "Foo %d", array(6), "bar" ) );
25
26// Close handle
27fclose($fp);
28
29?>
30===DONE===
31--CLEAN--
32<?php
33
34$file = 'vfprintf_test.txt';
35unlink( $file );
36
37?>
38--EXPECTF--
39-- Testing vfprintf() function with more than expected no. of arguments --
40
41Warning: Wrong parameter count for vfprintf() in %s on line %d
42NULL
43
44Warning: Wrong parameter count for vfprintf() in %s on line %d
45NULL
46===DONE===
47