1--TEST-- 2Test printf() function : basic functionality - float format 3--FILE-- 4<?php 5echo "*** Testing printf() : basic functionality - using float format ***\n"; 6 7 8// Initialise all required variables 9 10$format = "format"; 11$format1 = "%f"; 12$format2 = "%f %f"; 13$format3 = "%f %f %f"; 14 15$format11 = "%F"; 16$format22 = "%F %F"; 17$format33 = "%F %F %F"; 18$arg1 = 11.11; 19$arg2 = 22.22; 20$arg3 = 33.33; 21 22echo "\n-- Calling printf() with no arguments--\n"; 23$result = printf($format); 24echo "\n"; 25var_dump($result); 26 27echo "\n-- Calling printf() with one arguments--\n"; 28$result = printf($format1, $arg1); 29echo "\n"; 30var_dump($result); 31$result = printf($format11, $arg1); 32echo "\n"; 33var_dump($result); 34 35echo "\n-- Calling printf() with two arguments--\n"; 36$result = printf($format2, $arg1, $arg2); 37echo "\n"; 38var_dump($result); 39$result = printf($format22, $arg1, $arg2); 40echo "\n"; 41var_dump($result); 42 43echo "\n-- Calling printf() with three arguments--\n"; 44$result = printf($format3, $arg1, $arg2, $arg3); 45echo "\n"; 46var_dump($result); 47$result = printf($format33, $arg1, $arg2, $arg3); 48echo "\n"; 49var_dump($result); 50 51?> 52--EXPECT-- 53*** Testing printf() : basic functionality - using float format *** 54 55-- Calling printf() with no arguments-- 56format 57int(6) 58 59-- Calling printf() with one arguments-- 6011.110000 61int(9) 6211.110000 63int(9) 64 65-- Calling printf() with two arguments-- 6611.110000 22.220000 67int(19) 6811.110000 22.220000 69int(19) 70 71-- Calling printf() with three arguments-- 7211.110000 22.220000 33.330000 73int(29) 7411.110000 22.220000 33.330000 75int(29) 76