vprintf_basic7.phpt 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. --TEST--
  2. Test vprintf() function : basic functionality - unsigned format
  3. --SKIPIF--
  4. <?php
  5. if (PHP_INT_SIZE != 4) die("skip this test is for 32bit platform only");
  6. ?>
  7. --FILE--
  8. <?php
  9. /* Prototype : string vprintf(string $format , aaray $args)
  10. * Description: Output a formatted string
  11. * Source code: ext/standard/formatted_print.c
  12. */
  13. echo "*** Testing vprintf() : basic functionality - using unsigned format ***\n";
  14. // Initialise all required variables
  15. $format = "format";
  16. $format1 = "%u";
  17. $format2 = "%u %u";
  18. $format3 = "%u %u %u";
  19. $arg1 = array(-1111);
  20. $arg2 = array(-1111,-1234567);
  21. $arg3 = array(-1111,-1234567,-2345432);
  22. $result = vprintf($format1,$arg1);
  23. echo "\n";
  24. var_dump($result);
  25. $result = vprintf($format2,$arg2);
  26. echo "\n";
  27. var_dump($result);
  28. $result = vprintf($format3,$arg3);
  29. echo "\n";
  30. var_dump($result);
  31. ?>
  32. ===DONE===
  33. --EXPECT--
  34. *** Testing vprintf() : basic functionality - using unsigned format ***
  35. 4294966185
  36. int(10)
  37. 4294966185 4293732729
  38. int(21)
  39. 4294966185 4293732729 4292621864
  40. int(32)
  41. ===DONE===