Skip to content

Commit e47444d

Browse files
committed
Added test case for bug #75577
1 parent 09340ea commit e47444d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

ext/date/tests/bug75577.phpt

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
--TEST--
2+
Test for bug #75577: DateTime::createFromFormat does not accept 'v' format specifier
3+
--INI--
4+
date.timezone=Europe/London
5+
--FILE--
6+
<?php
7+
$d = new DateTime("2018-10-09 09:56:45.412000");
8+
var_dump($s = $d->format(DateTime::RFC3339_EXTENDED));
9+
10+
$d2 = DateTime::createFromFormat(DateTime::RFC3339_EXTENDED, $s);
11+
var_dump($d2);
12+
?>
13+
--EXPECTF--
14+
string(29) "2018-10-09T09:56:45.412+01:00"
15+
object(DateTime)#%d (3) {
16+
["date"]=>
17+
string(26) "2018-10-09 09:56:45.412000"
18+
["timezone_type"]=>
19+
int(1)
20+
["timezone"]=>
21+
string(6) "+01:00"
22+
}

0 commit comments

Comments
 (0)