1--TEST--
2Test printf() function : basic functionality - integer format
3--FILE--
4<?php
5echo "*** Testing printf() : 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
17echo "\n-- Calling printf() with no arguments --\n";
18$result = printf($format);
19echo "\n";
20var_dump($result);
21
22echo "\n-- Calling printf() with one arguments--\n";
23$result = printf($format1, $arg1);
24echo "\n";
25var_dump($result);
26
27echo "\n-- Calling printf() with two arguments--\n";
28$result = printf($format2, $arg1, $arg2);
29echo "\n";
30var_dump($result);
31
32echo "\n-- Calling printf() with three arguments--\n";
33$result = printf($format3, $arg1, $arg2, $arg3);
34echo "\n";
35var_dump($result);
36
37?>
38--EXPECT--
39*** Testing printf() : basic functionality - using integer format ***
40
41-- Calling printf() with no arguments --
42format
43int(6)
44
45-- Calling printf() with one arguments--
46111
47int(3)
48
49-- Calling printf() with two arguments--
50111 222
51int(7)
52
53-- Calling printf() with three arguments--
54111 222 333
55int(11)
56