xref: /PHP-8.4/ext/date/tests/gh11854.phpt (revision a8f41716)
1--TEST--
2Bug GH-11854 (DateTime:createFromFormat stopped parsing DateTime with extra space)
3--INI--
4date.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
9var_dump($dateTime);
10?>
11--EXPECTF--
12object(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}
20