timezone_open_basic1.phpt 886 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. --TEST--
  2. Test timezone_open() function : basic functionality
  3. --FILE--
  4. <?php
  5. /* Prototype : DateTimeZone timezone_open ( string $timezone )
  6. * Description: Returns new DateTimeZone object
  7. * Source code: ext/date/php_date.c
  8. * Alias to functions: DateTime::__construct()
  9. */
  10. echo "*** Testing timezone_open() : basic functionality ***\n";
  11. var_dump( timezone_open("GMT") );
  12. var_dump( timezone_open("Europe/London") );
  13. var_dump( timezone_open("America/Los_Angeles") );
  14. ?>
  15. ===DONE===
  16. --EXPECTF--
  17. *** Testing timezone_open() : basic functionality ***
  18. object(DateTimeZone)#%d (2) {
  19. ["timezone_type"]=>
  20. int(2)
  21. ["timezone"]=>
  22. string(3) "GMT"
  23. }
  24. object(DateTimeZone)#%d (2) {
  25. ["timezone_type"]=>
  26. int(3)
  27. ["timezone"]=>
  28. string(13) "Europe/London"
  29. }
  30. object(DateTimeZone)#%d (2) {
  31. ["timezone_type"]=>
  32. int(3)
  33. ["timezone"]=>
  34. string(19) "America/Los_Angeles"
  35. }
  36. ===DONE===