1--TEST--
2Test vfprintf() function : basic functionality - float format
3--FILE--
4<?php
5echo "*** Testing vfprintf() : basic functionality - using float format ***\n";
6
7// Initialise all required variables
8
9$format = "format";
10$format1 = "%f";
11$format2 = "%f %f";
12$format3 = "%f %f %f";
13
14$format11 = "%F";
15$format22 = "%F %F";
16$format33 = "%F %F %F";
17$arg1 = array(11.11);
18$arg2 = array(11.11,22.22);
19$arg3 = array(11.11,22.22,33.33);
20
21/* creating dumping file */
22$data_file = __DIR__ . '/vfprintf_basic3.txt';
23if (!($fp = fopen($data_file, 'wt')))
24   return;
25
26vfprintf($fp, $format1,$arg1);
27fprintf($fp, "\n");
28
29vfprintf($fp,$format11,$arg1);
30fprintf($fp, "\n");
31
32vfprintf($fp,$format2,$arg2);
33fprintf($fp, "\n");
34
35vfprintf($fp,$format22,$arg2);
36fprintf($fp, "\n");
37
38vfprintf($fp,$format3,$arg3);
39fprintf($fp, "\n");
40
41vfprintf($fp, $format33,$arg3);
42fprintf($fp, "\n");
43
44fclose($fp);
45print_r(file_get_contents($data_file));
46
47unlink($data_file);
48?>
49--EXPECT--
50*** Testing vfprintf() : basic functionality - using float format ***
5111.110000
5211.110000
5311.110000 22.220000
5411.110000 22.220000
5511.110000 22.220000 33.330000
5611.110000 22.220000 33.330000
57