gmstrftime_variation8.phpt 917 B

1234567891011121314151617181920212223242526272829303132333435
  1. --TEST--
  2. Test gmstrftime() function : usage variation - Passing literal related strings to format argument.
  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, "en_US");
  9. date_default_timezone_set("Asia/Calcutta");
  10. //array of values to iterate over
  11. $inputs = array(
  12. 'A literal % character' => "%%",
  13. );
  14. // loop through each element of the array for timestamp
  15. foreach($inputs as $key =>$value) {
  16. echo "\n--$key--\n";
  17. var_dump( gmstrftime($value) );
  18. var_dump( gmstrftime($value, $timestamp) );
  19. };
  20. ?>
  21. --EXPECTF--
  22. *** Testing gmstrftime() : usage variation ***
  23. --A literal % character--
  24. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  25. string(1) "%"
  26. Deprecated: Function gmstrftime() is deprecated in %s on line %d
  27. string(1) "%"