1--TEST-- 2Test printf() function : basic functionality - bool format 3--FILE-- 4<?php 5echo "*** Testing printf() : 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 17echo "\n-- Calling printf() with no arguments --\n"; 18$result = printf($format); 19echo "\n"; 20var_dump($result); 21 22echo "\n-- Calling printf() with one arguments--\n"; 23$result = printf($format1, $arg1); 24echo "\n"; 25var_dump($result); 26 27echo "\n-- Calling printf() with two arguments--\n"; 28$result = printf($format2, $arg1, $arg2); 29echo "\n"; 30var_dump($result); 31 32echo "\n-- Calling printf() with three arguments--\n"; 33$result = printf($format3, $arg1, $arg2, $arg3); 34echo "\n"; 35var_dump($result); 36?> 37--EXPECT-- 38*** Testing printf() : basic functionality - using bool format *** 39 40-- Calling printf() with no arguments -- 41format 42int(6) 43 44-- Calling printf() with one arguments-- 451 46int(1) 47 48-- Calling printf() with two arguments-- 491 0 50int(3) 51 52-- Calling printf() with three arguments-- 531 0 1 54int(5) 55