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