-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Constructor of IntlDateFormatter would leak if called twice. Made calling it more than once error out before starting using resources.
- Loading branch information
1 parent
51286bd
commit 07c0d71
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,14 @@ | |||
--TEST-- | |||
Bug #62081: IntlDateFormatter leaks memory if called twice | |||
--SKIPIF-- | |||
<?php | |||
if (!extension_loaded('intl')) | |||
die('skip intl extension not enabled'); | |||
--FILE-- | |||
<?php | |||
ini_set('intl.error_level', E_WARNING); | |||
$x = new IntlDateFormatter(1,1,1,1,1); | |||
var_dump($x->__construct(1,1,1,1,1)); | |||
--EXPECTF-- | |||
Warning: IntlDateFormatter::__construct(): datefmt_create: cannot call constructor twice in %s on line %d | |||
NULL |