vprintf_basic8.phpt 863 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. Test vprintf() function : basic functionality - octal 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 octal format ***\n";
  10. // Initialise all required variables
  11. $format = "format";
  12. $format1 = "%o";
  13. $format2 = "%o %o";
  14. $format3 = "%o %o %o";
  15. $arg1 = array(021);
  16. $arg2 = array(021,0347);
  17. $arg3 = array(021,0347,05678);
  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 octal format ***
  31. 21
  32. int(2)
  33. 21 347
  34. int(6)
  35. 21 347 567
  36. int(10)
  37. ===DONE===