vprintf_basic9.phpt 989 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. --TEST--
  2. Test vprintf() function : basic functionality - hexadecimal format
  3. --FILE--
  4. <?php
  5. echo "*** Testing vprintf() : basic functionality - using hexadecimal format ***\n";
  6. // Initialising different format strings
  7. $format = "format";
  8. $format1 = "%x";
  9. $format2 = "%x %x";
  10. $format3 = "%x %x %x";
  11. $format11 = "%X";
  12. $format22 = "%X %X";
  13. $format33 = "%X %X %X";
  14. $arg1 = array(11);
  15. $arg2 = array(11,132);
  16. $arg3 = array(11,132,177);
  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);echo "\n";
  30. var_dump($result);
  31. $result = vprintf($format33,$arg3);
  32. echo "\n";
  33. var_dump($result);
  34. ?>
  35. --EXPECT--
  36. *** Testing vprintf() : basic functionality - using hexadecimal format ***
  37. b
  38. int(1)
  39. B
  40. int(1)
  41. b 84
  42. int(4)
  43. B 84
  44. int(4)
  45. b 84 b1
  46. int(7)
  47. B 84 B1
  48. int(7)