vsprintf_basic7.phpt 959 B

123456789101112131415161718192021222324252627282930313233343536
  1. --TEST--
  2. Test vsprintf() 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 vsprintf(string $format , aaray $args)
  10. * Description: Return a formatted string
  11. * Source code: ext/standard/formatted_print.c
  12. */
  13. echo "*** Testing vsprintf() : 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. var_dump( vsprintf($format1,$arg1) );
  23. var_dump( vsprintf($format2,$arg2) );
  24. var_dump( vsprintf($format3,$arg3) );
  25. echo "Done";
  26. ?>
  27. --EXPECTF--
  28. *** Testing vsprintf() : basic functionality - using unsigned format ***
  29. string(10) "4294966185"
  30. string(21) "4294966185 4293732729"
  31. string(32) "4294966185 4293732729 4292621864"
  32. Done