msgfmt_setPattern_cache.phpt 592 B

1234567891011121314151617181920212223242526
  1. --TEST--
  2. MessageFormatter::setPattern() invalidates arg types cache
  3. --SKIPIF--
  4. <?php
  5. if (!extension_loaded('intl'))
  6. die('skip intl extension not enabled');
  7. --FILE--
  8. <?php
  9. ini_set("intl.error_level", E_WARNING);
  10. //ini_set("intl.default_locale", "nl");
  11. $mf = new MessageFormatter('en_US',
  12. "{0,number} -- {1,ordinal}");
  13. var_dump($mf->format(array(1.3, 1.3)));
  14. var_dump($mf->format(array(1.3, 1.3)));
  15. $mf->setPattern("{0,ordinal} -- {1,number}");
  16. var_dump($mf->format(array(1.3, 1.3)));
  17. ?>
  18. ==DONE==
  19. --EXPECT--
  20. string(10) "1.3 -- 1st"
  21. string(10) "1.3 -- 1st"
  22. string(10) "1st -- 1.3"
  23. ==DONE==