1--TEST--
2Test sprintf() function : usage variations - with whitespaces in format strings
3--FILE--
4<?php
5echo "*** Testing sprintf() : with  white spaces in format strings ***\n";
6
7// initializing the format array
8$formats = array(
9  "% d", "%  d", "%   d",
10  "% f", "%  f", "%   f",
11  "% F", "%  F", "%   F",
12  "% b", "%  b", "%   b",
13  "% c", "%  c", "%   c",
14  "% e", "%  e", "%   e",
15  "% u", "%  u", "%   u",
16  "% o", "%  o", "%   o",
17  "% x", "%  x", "%   x",
18  "% X", "%  X", "%   X",
19  "% E", "%  E", "%   E"
20);
21
22// initializing the args array
23
24foreach($formats as $format) {
25  var_dump( sprintf($format, 1234) );
26}
27
28echo "Done";
29?>
30--EXPECT--
31*** Testing sprintf() : with  white spaces in format strings ***
32string(4) "1234"
33string(4) "1234"
34string(4) "1234"
35string(11) "1234.000000"
36string(11) "1234.000000"
37string(11) "1234.000000"
38string(11) "1234.000000"
39string(11) "1234.000000"
40string(11) "1234.000000"
41string(11) "10011010010"
42string(11) "10011010010"
43string(11) "10011010010"
44string(1) "�"
45string(1) "�"
46string(1) "�"
47string(11) "1.234000e+3"
48string(11) "1.234000e+3"
49string(11) "1.234000e+3"
50string(4) "1234"
51string(4) "1234"
52string(4) "1234"
53string(4) "2322"
54string(4) "2322"
55string(4) "2322"
56string(3) "4d2"
57string(3) "4d2"
58string(3) "4d2"
59string(3) "4D2"
60string(3) "4D2"
61string(3) "4D2"
62string(11) "1.234000E+3"
63string(11) "1.234000E+3"
64string(11) "1.234000E+3"
65Done
66