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