1--TEST--
2Test vsprintf() function : basic functionality - string 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 string format ***\n";
11
12// Initialise all required variables
13$format = "format";
14$format1 = "%s";
15$format2 = "%s %s";
16$format3 = "%s %s %s";
17$arg1 = array("one");
18$arg2 = array("one","two");
19$arg3 = array("one","two","three");
20
21
22var_dump( vsprintf($format1,$arg1) );
23var_dump( vsprintf($format2,$arg2) );
24var_dump( vsprintf($format3,$arg3) );
25
26echo "Done";
27?>
28--EXPECTF--
29*** Testing vsprintf() : basic functionality - using string format ***
30string(3) "one"
31string(7) "one two"
32string(13) "one two three"
33Done
34