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