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