vprintf_basic6.phpt 933 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. --TEST--
  2. Test vprintf() function : basic functionality - exponential 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 exponential format ***\n";
  10. // Initialise all required variables
  11. $format = "format";
  12. $format1 = "%e";
  13. $format2 = "%e %e";
  14. $format3 = "%e %e %e";
  15. $arg1 = array(1000);
  16. $arg2 = array(1000,2000);
  17. $arg3 = array(1000,2000,3000);
  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 exponential format ***
  31. 1.000000e+3
  32. int(11)
  33. 1.000000e+3 2.000000e+3
  34. int(23)
  35. 1.000000e+3 2.000000e+3 3.000000e+3
  36. int(35)
  37. ===DONE===