1--TEST-- 2Test printf() function : basic functionality - exponential format 3--FILE-- 4<?php 5echo "*** Testing printf() : 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 16echo "\n-- Calling printf() with no arguments --\n"; 17$result = printf($format); 18echo "\n"; 19var_dump($result); 20 21echo "\n-- Calling printf() with one argument --\n"; 22$result = printf($format1, $arg1); 23echo "\n"; 24var_dump($result); 25 26echo "\n-- Calling printf() with two arguments --\n"; 27$result = printf($format2, $arg1, $arg2); 28echo "\n"; 29var_dump($result); 30 31echo "\n-- Calling printf() with three arguments --\n"; 32$result = printf($format3, $arg1, $arg2, $arg3); 33echo "\n"; 34var_dump($result); 35?> 36--EXPECT-- 37*** Testing printf() : basic functionality - using exponential format *** 38 39-- Calling printf() with no arguments -- 40format 41int(6) 42 43-- Calling printf() with one argument -- 441.000000e+3 45int(11) 46 47-- Calling printf() with two arguments -- 481.000000E+3 2.000000e+3 49int(23) 50 51-- Calling printf() with three arguments -- 521.000000e+3 2.000000E+3 3.000000e+3 53int(35) 54