vfprintf_basic4.phpt 813 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. Test vfprintf() function : basic functionality - bool format
  3. --FILE--
  4. <?php
  5. echo "*** Testing vfprintf() : basic functionality - using bool format ***\n";
  6. // Initialise all required variables
  7. $format = "format";
  8. $format1 = "%b";
  9. $format2 = "%b %b";
  10. $format3 = "%b %b %b";
  11. $arg1 = array(TRUE);
  12. $arg2 = array(TRUE,FALSE);
  13. $arg3 = array(TRUE,FALSE,TRUE);
  14. /* creating dumping file */
  15. $data_file = __DIR__ . '/vfprintf_basic4.txt';
  16. if (!($fp = fopen($data_file, 'wt')))
  17. return;
  18. vfprintf($fp, $format1,$arg1);
  19. fprintf($fp, "\n");
  20. vfprintf($fp, $format2,$arg2);
  21. fprintf($fp, "\n");
  22. vfprintf($fp, $format3,$arg3);
  23. fprintf($fp, "\n");
  24. fclose($fp);
  25. print_r(file_get_contents($data_file));
  26. unlink($data_file);
  27. ?>
  28. --EXPECT--
  29. *** Testing vfprintf() : basic functionality - using bool format ***
  30. 1
  31. 1 0
  32. 1 0 1