ini_use_exceptions_basic.phpt 787 B

123456789101112131415161718192021
  1. --TEST--
  2. intl.use_exceptions INI setting
  3. --SKIPIF--
  4. <?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?>
  5. --FILE--
  6. <?php
  7. ini_set("intl.use_exceptions", true);
  8. $t = transliterator_create('any-hex');
  9. try {
  10. var_dump($t->transliterate('a', 3));
  11. } catch (IntlException $intlE) {
  12. var_dump($intlE->getMessage());
  13. }
  14. ini_set("intl.use_exceptions", false);
  15. ini_set("intl.error_level", E_NOTICE);
  16. var_dump($t->transliterate('a', 3));
  17. --EXPECTF--
  18. string(130) "transliterator_transliterate: Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 1)"
  19. Notice: Transliterator::transliterate(): transliterator_transliterate: Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 1) in %s on line %d
  20. bool(false)