1--TEST--
2Test sprintf() function : basic functionality - integer format
3--FILE--
4<?php
5echo "*** Testing sprintf() : basic functionality - using integer format ***\n";
6
7
8// Initialise all required variables
9$format = "format";
10$format1 = "%d";
11$format2 = "%d %d";
12$format3 = "%d %d %d";
13$arg1 = 111;
14$arg2 = 222;
15$arg3 = 333;
16
17// Calling sprintf() with default arguments
18var_dump( sprintf($format) );
19
20// Calling sprintf() with two arguments
21var_dump( sprintf($format1, $arg1) );
22
23// Calling sprintf() with three arguments
24var_dump( sprintf($format2, $arg1, $arg2) );
25
26// Calling sprintf() with four arguments
27var_dump( sprintf($format3, $arg1, $arg2, $arg3) );
28
29echo "Done";
30?>
31--EXPECT--
32*** Testing sprintf() : basic functionality - using integer format ***
33string(6) "format"
34string(3) "111"
35string(7) "111 222"
36string(11) "111 222 333"
37Done
38