xref: /PHP-8.2/ext/date/tests/bug75577.phpt (revision e47444d1)
1--TEST--
2Test for bug #75577: DateTime::createFromFormat does not accept 'v' format specifier
3--INI--
4date.timezone=Europe/London
5--FILE--
6<?php
7$d = new DateTime("2018-10-09 09:56:45.412000");
8var_dump($s = $d->format(DateTime::RFC3339_EXTENDED));
9
10$d2 = DateTime::createFromFormat(DateTime::RFC3339_EXTENDED, $s);
11var_dump($d2);
12?>
13--EXPECTF--
14string(29) "2018-10-09T09:56:45.412+01:00"
15object(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}
23