timezone_getDisplayName_variant3.phpt 797 B

12345678910111213141516171819202122232425262728
  1. --TEST--
  2. IntlTimeZone::getDisplayName(): locale parameter
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('intl'))
  6. die('skip intl extension not enabled');
  7. if (version_compare(INTL_ICU_VERSION, '49') >= 0)
  8. die('skip for ICU <= 4.8');
  9. --FILE--
  10. <?php
  11. ini_set("intl.error_level", E_WARNING);
  12. ini_set("error_reporting", -1);
  13. ini_set("display_errors", 1);
  14. $lsb = IntlTimeZone::createTimeZone('Europe/Lisbon');
  15. ini_set('intl.default_locale', 'en_US');
  16. var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG));
  17. var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG, NULL));
  18. var_dump($lsb->getDisplayName(false, IntlTimeZone::DISPLAY_LONG, 'pt_PT'));
  19. ?>
  20. ==DONE==
  21. --EXPECT--
  22. string(21) "Western European Time"
  23. string(21) "Western European Time"
  24. string(24) "Hora da Europa Ocidental"
  25. ==DONE==