vprintf_basic1.phpt 700 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Test vprintf() function : basic functionality - string format
  3. --FILE--
  4. <?php
  5. echo "*** Testing vprintf() : basic functionality - using string format ***\n";
  6. // Initialise all required variables
  7. $format = "format";
  8. $format1 = "%s";
  9. $format2 = "%s %s";
  10. $format3 = "%s %s %s";
  11. $arg1 = array("one");
  12. $arg2 = array("one","two");
  13. $arg3 = array("one","two","three");
  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 string format ***
  26. one
  27. int(3)
  28. one two
  29. int(7)
  30. one two three
  31. int(13)