3v4l.org

run code in 300+ 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.21, 8.0.3
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.010+02:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2019-05-06 00:29:01.010000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" }
Output for 7.4.4, 7.4.10, 7.4.13, 8.0.2
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.012+02:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2019-05-06 00:29:01.012000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" }
Output for 7.3.19, 7.4.9, 8.0.0
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.4.16
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.3.16 - 7.3.17, 7.3.20, 7.3.23 - 7.3.26, 7.4.7, 7.4.11, 7.4.14
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.4.12
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.021+02:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2019-05-06 00:29:01.021000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" }
Output for 7.4.8
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.011+02:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2019-05-06 00:29:01.011000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" }
Output for 7.3.0 - 7.3.13, 7.4.0 - 7.4.1, 7.4.6
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.000+02:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2019-05-06 00:29:01.000000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" }
Output for 7.4.5
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.002+02:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2019-05-06 00:29:01.002000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" }
Output for 7.3.18
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.004+02:00" object(DateTime)#1 (3) { ["date"]=> string(26) "2019-05-06 00:29:01.004000" ["timezone_type"]=> int(1) ["timezone"]=> string(6) "+02:00" }
Output for 7.2.33
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.013+02:00" bool(false)
Output for 7.2.32
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.011+02:00" bool(false)
Output for 7.2.31
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.009+02:00" bool(false)
Output for 7.2.30
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.016+02:00" bool(false)
Output for 7.2.29
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.008+02:00" bool(false)
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.26
string(15) "Y-m-d\TH:i:s.vP" string(29) "2019-05-06T00:29:01.000+02:00" bool(false)