Skip to content

Commit a8f4171

Browse files
committedAug 3, 2023
Fixed bug GH-11854 (DateTime:createFromFormat stopped parsing datetime with extra space)
1 parent 851890b commit a8f4171

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
 

‎NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ PHP NEWS
66
. Fixed bug GH-11716 (cli server crashes on SIGINT when compiled with
77
ZEND_RC_DEBUG=1). (nielsdos)
88

9+
- Date:
10+
. Fixed bug GH-11854 (DateTime:createFromFormat stopped parsing datetime with
11+
extra space). (nielsdos, Derick)
12+
913
- DOM:
1014
. Fix DOMEntity field getter bugs. (nielsdos)
1115
. Fix incorrect attribute existence check in DOMElement::setAttributeNodeNS.

‎ext/date/tests/gh11854.phpt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
--TEST--
2+
Bug GH-11854 (DateTime:createFromFormat stopped parsing DateTime with extra space)
3+
--INI--
4+
date.timezone=UTC
5+
--FILE--
6+
<?php
7+
$dateTime = DateTime::createFromFormat("D M d H:i:s Y", "Wed Aug 2 08:37:50 2023");
8+
9+
var_dump($dateTime);
10+
?>
11+
--EXPECTF--
12+
object(DateTime)#1 (3) {
13+
["date"]=>
14+
string(26) "2023-08-02 08:37:50.000000"
15+
["timezone_type"]=>
16+
int(3)
17+
["timezone"]=>
18+
string(3) "UTC"
19+
}

0 commit comments

Comments
 (0)
Please sign in to comment.