vprintf_basic5.phpt 837 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. Test vprintf() function : basic functionality - char 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 char format ***\n";
  10. // Initialise all required variables
  11. $format = "format";
  12. $format1 = "%c";
  13. $format2 = "%c %c";
  14. $format3 = "%c %c %c";
  15. $arg1 = array(65);
  16. $arg2 = array(65,66);
  17. $arg3 = array(65,66,67);
  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 char format ***
  31. A
  32. int(1)
  33. A B
  34. int(3)
  35. A B C
  36. int(5)
  37. ===DONE===