bug62081.phpt 537 B

123456789101112131415161718
  1. --TEST--
  2. Bug #62081: IntlDateFormatter leaks memory if called twice
  3. --INI--
  4. date.timezone=Atlantic/Azores
  5. --EXTENSIONS--
  6. intl
  7. --FILE--
  8. <?php
  9. ini_set('intl.error_level', E_WARNING);
  10. $x = new IntlDateFormatter('en', 1, 1);
  11. var_dump($x->__construct('en', 1, 1));
  12. ?>
  13. --EXPECTF--
  14. Fatal error: Uncaught IntlException: IntlDateFormatter::__construct(): datefmt_create: cannot call constructor twice in %sbug62081.php:4
  15. Stack trace:
  16. #0 %sbug62081.php(4): IntlDateFormatter->__construct('en', 1, 1)
  17. #1 {main}
  18. thrown in %sbug62081.php on line 4