3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Time extends DateTime { public static function createFromFormat(string $format , string $time, DateTimeZone $timezone = null) { return parent::createFromFormat($format, $time, $timezone); } } var_dump(DateTime::createFromFormat('Y-m-d', '2015-01-01'));
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Deprecated: Return type of Time::createFromFormat(string $format, string $time, ?DateTimeZone $timezone = null) should either be compatible with DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/4tnZa on line 5 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 22:32:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Deprecated: Return type of Time::createFromFormat(string $format, string $time, ?DateTimeZone $timezone = null) should either be compatible with DateTime::createFromFormat(string $format, string $datetime, ?DateTimeZone $timezone = null): DateTime|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/4tnZa on line 5 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 22:32:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.0 - 8.0.12, 8.0.14 - 8.0.30
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 22:32:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 8.0.13
object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 21:32:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 7.4.0 - 7.4.33
Warning: Declaration of Time::createFromFormat(string $format, string $time, ?DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, ?DateTimeZone $object = NULL) in /in/4tnZa on line 5 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 22:32:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.3.32 - 7.3.33
Warning: Declaration of Time::createFromFormat(string $format, string $time, ?DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, ?DateTimeZone $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 21:32:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(3) "UTC" }
Output for 7.2.0 - 7.2.33, 7.3.16 - 7.3.31
Warning: Declaration of Time::createFromFormat(string $format, string $time, ?DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, ?DateTimeZone $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 22:32:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.1.0 - 7.1.20
Warning: Declaration of Time::createFromFormat(string $format, string $time, ?DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 22:32:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.20
Warning: Declaration of Time::createFromFormat(string $format, string $time, DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 22:32:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.6
Warning: Declaration of Time::createFromFormat(string $format, string $time, DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 13:26:29.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.5
Warning: Declaration of Time::createFromFormat(string $format, string $time, DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 09:27:42.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.4
Warning: Declaration of Time::createFromFormat(string $format, string $time, DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 21:34:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.3
Warning: Declaration of Time::createFromFormat(string $format, string $time, DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 22:58:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.2
Warning: Declaration of Time::createFromFormat(string $format, string $time, DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 05:12:02.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.1
Warning: Declaration of Time::createFromFormat(string $format, string $time, DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 08:18:44.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 7.0.0
Warning: Declaration of Time::createFromFormat(string $format, string $time, DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 10:12:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.28
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 22:32:46.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.21
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 16:20:55.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.20
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 08:29:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.19
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 05:42:38.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.18
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 14:39:51.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.17
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 02:12:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.16
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 11:01:23.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.15
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 11:50:35.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.14
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 17:33:08.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.13
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 18:12:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.12
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 08:41:21.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.11
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 15:07:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.10
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 17:13:16.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.9
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 22:39:20.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.6.8
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 07:09:19.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.35
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 02:20:27.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.34
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 10:43:28.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.33
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 08:41:30.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.32
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 18:36:40.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.31
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 05:21:25.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.30
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 13:42:48.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.29
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 08:30:10.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.28
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 11:59:52.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.27
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 13:38:15.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.26
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 19:54:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.25
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 03:19:54.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }
Output for 5.5.24
Strict Standards: Declaration of Time::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/4tnZa on line 9 object(DateTime)#1 (3) { ["date"]=> string(26) "2015-01-01 09:43:05.000000" ["timezone_type"]=> int(3) ["timezone"]=> string(16) "Europe/Amsterdam" }

preferences:
203.43 ms | 401 KiB | 184 Q