1--TEST--
2Test vsprintf() function : basic functionality - float format
3--FILE--
4<?php
5/* Prototype  : string vsprintf(string $format , array $args)
6 * Description: Return a formatted string
7 * Source code: ext/standard/formatted_print.c
8*/
9
10echo "*** Testing vsprintf() : basic functionality - using float format ***\n";
11
12// Initialise all required variables
13
14$format = "format";
15$format1 = "%f";
16$format2 = "%f %f";
17$format3 = "%f %f %f";
18
19$format11 = "%F";
20$format22 = "%F %F";
21$format33 = "%F %F %F";
22$arg1 = array(11.11);
23$arg2 = array(11.11,22.22);
24$arg3 = array(11.11,22.22,33.33);
25
26var_dump( vsprintf($format1,$arg1) );
27var_dump( vsprintf($format11,$arg1) );
28
29var_dump( vsprintf($format2,$arg2) );
30var_dump( vsprintf($format22,$arg2) );
31
32var_dump( vsprintf($format3,$arg3) );
33var_dump( vsprintf($format33,$arg3) );
34
35echo "Done";
36?>
37--EXPECT--
38*** Testing vsprintf() : basic functionality - using float format ***
39string(9) "11.110000"
40string(9) "11.110000"
41string(19) "11.110000 22.220000"
42string(19) "11.110000 22.220000"
43string(29) "11.110000 22.220000 33.330000"
44string(29) "11.110000 22.220000 33.330000"
45Done
46