vprintf_basic4.phpt 851 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. Test vprintf() function : basic functionality - bool format
  3. --FILE--
  4. <?php
  5. /* Prototype : string vprintf(string $format , array $args)
  6. * Description: Output a formatted string
  7. * Source code: ext/standard/formatted_print.c
  8. */
  9. echo "*** Testing vprintf() : basic functionality - using bool format ***\n";
  10. // Initialise all required variables
  11. $format = "format";
  12. $format1 = "%b";
  13. $format2 = "%b %b";
  14. $format3 = "%b %b %b";
  15. $arg1 = array(TRUE);
  16. $arg2 = array(TRUE,FALSE);
  17. $arg3 = array(TRUE,FALSE,TRUE);
  18. $result = vprintf($format1,$arg1);
  19. echo "\n";
  20. var_dump($result);
  21. $result = vprintf($format2,$arg2);
  22. echo "\n";
  23. var_dump($result);
  24. $result = vprintf($format3,$arg3);
  25. echo "\n";
  26. var_dump($result);
  27. ?>
  28. ===DONE===
  29. --EXPECT--
  30. *** Testing vprintf() : basic functionality - using bool format ***
  31. 1
  32. int(1)
  33. 1 0
  34. int(3)
  35. 1 0 1
  36. int(5)
  37. ===DONE===