009.phpt 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. --TEST--
  2. strftime() and gmstrftime() tests
  3. --SKIPIF--
  4. <?php
  5. if (substr(PHP_OS, 0, 3) == 'WIN') die('skip posix only test.');
  6. ?>
  7. --FILE--
  8. <?php
  9. date_default_timezone_set('Asia/Jerusalem');
  10. $t = mktime(0,0,0, 6, 27, 2006);
  11. var_dump(strftime(""));
  12. var_dump(strftime("%a %A %b %B %c %C %d %D %e %g %G %h %H %I %j %m %M %n %p %r %R %S %t %T %u %U %V %W %w %x %X %y %Y %Z %z %%", $t));
  13. var_dump(strftime("%%q %%a", $t));
  14. var_dump(strftime("blah", $t));
  15. var_dump(gmstrftime(""));
  16. var_dump(gmstrftime("%a %A %b %B %c %C %d %D %e %g %G %h %H %I %j %m %M %n %p %r %R %S %t %T %u %U %V %W %w %x %X %y %Y %Z %z %%", $t));
  17. var_dump(gmstrftime("%%q %%a", $t));
  18. var_dump(gmstrftime("blah", $t));
  19. echo "Done\n";
  20. ?>
  21. --EXPECTF--
  22. Deprecated: Function strftime() is deprecated in %s on line %d
  23. bool(false)
  24. Deprecated: Function strftime() is deprecated in %s on line %d
  25. string(%d) "Tue Tuesday Jun June Tue Jun 27 00:00:00 2006 %s
  26. %s %"
  27. Deprecated: Function strftime() is deprecated in %s on line %d
  28. string(5) "%q %a"
  29. Deprecated: Function strftime() is deprecated in %s on line %d
  30. string(4) "blah"
  31. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  32. bool(false)
  33. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  34. string(%d) "Mon Monday Jun June Mon Jun 26 21:00:00 2006 %s
  35. %s %"
  36. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  37. string(5) "%q %a"
  38. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  39. string(4) "blah"
  40. Done