vprintf_basic5.phpt 660 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Test vprintf() function : basic functionality - char format
  3. --FILE--
  4. <?php
  5. echo "*** Testing vprintf() : basic functionality - using char format ***\n";
  6. // Initialise all required variables
  7. $format = "format";
  8. $format1 = "%c";
  9. $format2 = "%c %c";
  10. $format3 = "%c %c %c";
  11. $arg1 = array(65);
  12. $arg2 = array(65,66);
  13. $arg3 = array(65,66,67);
  14. $result = vprintf($format1,$arg1);
  15. echo "\n";
  16. var_dump($result);
  17. $result = vprintf($format2,$arg2);
  18. echo "\n";
  19. var_dump($result);
  20. $result = vprintf($format3,$arg3);
  21. echo "\n";
  22. var_dump($result);
  23. ?>
  24. --EXPECT--
  25. *** Testing vprintf() : basic functionality - using char format ***
  26. A
  27. int(1)
  28. A B
  29. int(3)
  30. A B C
  31. int(5)