xref: /PHP-7.2/ext/intl/tests/bug62081.phpt (revision 3ae995f0)
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--EXPECTF--
15Fatal error: Uncaught IntlException: IntlDateFormatter::__construct(): datefmt_create: cannot call constructor twice in %sbug62081.php:4
16Stack trace:
17#0 %sbug62081.php(4): IntlDateFormatter->__construct('en', 1, 1)
18#1 {main}
19  thrown in %sbug62081.php on line 4
20