gh8115.phpt 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --TEST--
  2. GH-8115 (Can't catch deprecation in IntlDateFormatter)
  3. --EXTENSIONS--
  4. intl
  5. --FILE--
  6. <?php
  7. error_reporting(E_ALL);
  8. set_error_handler(function ($errNo, $errStr) {
  9. echo "Caught ($errNo): $errStr\n";
  10. });
  11. try {
  12. new \IntlDateFormatter(null, null, null);
  13. } catch (\IntlException) {}
  14. try {
  15. new \IntlRuleBasedBreakIterator(null, null);
  16. } catch (\IntlException) {}
  17. // Can't be tested since all params are optional
  18. new \IntlGregorianCalendar(null, null);
  19. new \Collator(null);
  20. // Can't be tested since all params are optional
  21. new \IntlDatePatternGenerator(null);
  22. new \NumberFormatter(null, null);
  23. try {
  24. new \MessageFormatter(null, null);
  25. } catch (\IntlException) {}
  26. new \ResourceBundle(null, null, null);
  27. ?>
  28. --EXPECT--
  29. Caught (8192): IntlDateFormatter::__construct(): Passing null to parameter #2 ($dateType) of type int is deprecated
  30. Caught (8192): IntlDateFormatter::__construct(): Passing null to parameter #3 ($timeType) of type int is deprecated
  31. Caught (8192): IntlRuleBasedBreakIterator::__construct(): Passing null to parameter #1 ($rules) of type string is deprecated
  32. Caught (8192): IntlRuleBasedBreakIterator::__construct(): Passing null to parameter #2 ($compiled) of type bool is deprecated
  33. Caught (8192): Collator::__construct(): Passing null to parameter #1 ($locale) of type string is deprecated
  34. Caught (8192): NumberFormatter::__construct(): Passing null to parameter #1 ($locale) of type string is deprecated
  35. Caught (8192): NumberFormatter::__construct(): Passing null to parameter #2 ($style) of type int is deprecated
  36. Caught (8192): MessageFormatter::__construct(): Passing null to parameter #1 ($locale) of type string is deprecated
  37. Caught (8192): MessageFormatter::__construct(): Passing null to parameter #2 ($pattern) of type string is deprecated
  38. Caught (8192): ResourceBundle::__construct(): Passing null to parameter #3 ($fallback) of type bool is deprecated