gmstrftime_variation19.phpt 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. --TEST--
  2. Test gmstrftime() function : usage variation - Checking newline and tab formats which was not supported on Windows before VC14.
  3. --FILE--
  4. <?php
  5. echo "*** Testing gmstrftime() : usage variation ***\n";
  6. // Initialise function arguments not being substituted (if any)
  7. $timestamp = gmmktime(8, 8, 8, 8, 8, 2008);
  8. setlocale(LC_ALL, "C");
  9. date_default_timezone_set("Asia/Calcutta");
  10. //array of values to iterate over
  11. $inputs = array(
  12. 'Newline character' => "%n",
  13. 'Tab character' => "%t"
  14. );
  15. // loop through each element of the array for timestamp
  16. foreach($inputs as $key =>$value) {
  17. echo "\n--$key--\n";
  18. var_dump( gmstrftime($value) );
  19. var_dump( gmstrftime($value, $timestamp) );
  20. };
  21. ?>
  22. --EXPECTF--
  23. *** Testing gmstrftime() : usage variation ***
  24. --Newline character--
  25. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  26. string(1) "
  27. "
  28. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  29. string(1) "
  30. "
  31. --Tab character--
  32. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  33. string(1) " "
  34. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  35. string(1) " "