3v4l.org

run code in 200+ PHP versions simultaneously
<?php $f = "Y-m-d\TH:i:s.vP"; $t = (new DateTime())->format($f); $r = DateTime::createFromFormat($f, $t); var_dump( $f, $t, $r );
Output for 7.3.5
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.009+02:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2019-05-06 00:29:01.009000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" }
Output for 7.3.4
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.013+02:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2019-05-06 00:29:01.013000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" }
Output for 7.3.3
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.008+02:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2019-05-06 00:29:01.008000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" }
Output for 7.3.2
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.003+02:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2019-05-06 00:29:01.003000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" }
Output for 7.3.0 - 7.3.1
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.007+02:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2019-05-06 00:29:01.007000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" }
Output for 7.1.25, 7.2.7, 7.2.10, 7.2.13, 7.2.18
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.003+02:00" bool(false)
Output for 7.2.16 - 7.2.17
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.005+02:00" bool(false)
Output for 7.1.26, 7.2.3 - 7.2.4, 7.2.6, 7.2.11, 7.2.15
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.002+02:00" bool(false)
Output for 7.1.27, 7.2.2, 7.2.5, 7.2.8, 7.2.14
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.004+02:00" bool(false)
Output for 7.2.12
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.020+02:00" bool(false)
Output for 7.2.0, 7.2.9
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.000+02:00" bool(false)
Output for 7.1.28, 7.2.1
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.001+02:00" bool(false)