vprintf_basic3.phpt 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. --TEST--
  2. Test vprintf() function : basic functionality - float format
  3. --FILE--
  4. <?php
  5. echo "*** Testing vprintf() : basic functionality - using float format ***\n";
  6. // Initialise all required variables
  7. $format = "format";
  8. $format1 = "%f";
  9. $format2 = "%f %f";
  10. $format3 = "%f %f %f";
  11. $format11 = "%F";
  12. $format22 = "%F %F";
  13. $format33 = "%F %F %F";
  14. $arg1 = array(11.11);
  15. $arg2 = array(11.11,22.22);
  16. $arg3 = array(11.11,22.22,33.33);
  17. $result = vprintf($format1,$arg1);
  18. echo "\n";
  19. var_dump($result);
  20. $result = vprintf($format11,$arg1);
  21. echo "\n";
  22. var_dump($result);
  23. $result = vprintf($format2,$arg2);
  24. echo "\n";
  25. var_dump($result);
  26. $result = vprintf($format22,$arg2);
  27. echo "\n";
  28. var_dump($result);
  29. $result = vprintf($format3,$arg3);
  30. echo "\n";
  31. var_dump($result);
  32. $result = vprintf($format33,$arg3);
  33. echo "\n";
  34. var_dump($result);
  35. ?>
  36. --EXPECT--
  37. *** Testing vprintf() : basic functionality - using float format ***
  38. 11.110000
  39. int(9)
  40. 11.110000
  41. int(9)
  42. 11.110000 22.220000
  43. int(19)
  44. 11.110000 22.220000
  45. int(19)
  46. 11.110000 22.220000 33.330000
  47. int(29)
  48. 11.110000 22.220000 33.330000
  49. int(29)