1--TEST--
2Test vfprintf() function : basic functionality - exponential format
3--FILE--
4<?php
5/* Prototype  : int vfprintf  ( resource $handle  , string $format , array $args  )
6 * Description: Write a formatted string to a stream
7 * Source code: ext/standard/formatted_print.c
8*/
9
10
11echo "*** Testing vfprintf() : basic functionality - using exponential format ***\n";
12
13// Initialise all required variables
14$format = "format";
15$format1 = "%e";
16$format2 = "%e %e";
17$format3 = "%e %e %e";
18$arg1 = array(1000);
19$arg2 = array(1000,2000);
20$arg3 = array(1000,2000,3000);
21
22/* creating dumping file */
23$data_file = dirname(__FILE__) . '/vfprintf_basic6.txt';
24if (!($fp = fopen($data_file, 'wt')))
25   return;
26
27vfprintf($fp, $format1,$arg1);
28fprintf($fp, "\n");
29
30vfprintf($fp, $format2,$arg2);
31fprintf($fp, "\n");
32
33vfprintf($fp, $format3,$arg3);
34fprintf($fp, "\n");
35
36fclose($fp);
37print_r(file_get_contents($data_file));
38
39unlink($data_file);
40
41?>
42===DONE===
43--EXPECT--
44*** Testing vfprintf() : basic functionality - using exponential format ***
451.000000e+3
461.000000e+3 2.000000e+3
471.000000e+3 2.000000e+3 3.000000e+3
48===DONE===
49