vsprintf_basic4.phpt 784 B

1234567891011121314151617181920212223242526272829303132
  1. --TEST--
  2. Test vsprintf() function : basic functionality - bool format
  3. --FILE--
  4. <?php
  5. /* Prototype : string vsprintf(string $format , array $args)
  6. * Description: Return a formatted string
  7. * Source code: ext/standard/formatted_print.c
  8. */
  9. echo "*** Testing vsprintf() : basic functionality - using bool format ***\n";
  10. // Initialise all required variables
  11. $format = "format";
  12. $format1 = "%b";
  13. $format2 = "%b %b";
  14. $format3 = "%b %b %b";
  15. $arg1 = array(TRUE);
  16. $arg2 = array(TRUE,FALSE);
  17. $arg3 = array(TRUE,FALSE,TRUE);
  18. var_dump( vsprintf($format1,$arg1) );
  19. var_dump( vsprintf($format2,$arg2) );
  20. var_dump( vsprintf($format3,$arg3) );
  21. echo "Done";
  22. ?>
  23. --EXPECTF--
  24. *** Testing vsprintf() : basic functionality - using bool format ***
  25. string(1) "1"
  26. string(3) "1 0"
  27. string(5) "1 0 1"
  28. Done