gmstrftime_variation20.phpt 1.2 KB

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