Skip to content

Commit 78d5076

Browse files
committed
Fixed bug #51987 (Datetime fails to parse an ISO 8601 ordinal date (extended format))
1 parent 23dbefd commit 78d5076

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ PHP NEWS
77

88
- Date:
99
. Fixed bug #51934 (strtotime plurals / incorrect time). (Derick)
10+
. Fixed bug #51987 (Datetime fails to parse an ISO 8601 ordinal date
11+
(extended format)). (Derick)
1012
. Fixed bug #66019 (DateTime object does not support short ISO 8601 time
1113
format - YYYY-MM-DDTHH) (cmb, Derick)
1214
. Fixed bug #68549 (Timezones and offsets are not properly used when working

ext/date/tests/bug51987.phpt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
--TEST--
2+
Bug #51987 (Datetime fails to parse an ISO 8601 ordinal date (extended format))
3+
--FILE--
4+
<?php
5+
date_default_timezone_set('Europe/London');
6+
$d2 = new Datetime('1985-102');
7+
var_dump($d2);
8+
?>
9+
--EXPECTF--
10+
object(DateTime)#%d (%d) {
11+
["date"]=>
12+
string(26) "1985-04-12 00:00:00.000000"
13+
["timezone_type"]=>
14+
int(3)
15+
["timezone"]=>
16+
string(13) "Europe/London"
17+
}

0 commit comments

Comments
 (0)