3v4l.org

run code in 300+ PHP versions simultaneously
<?php class My_DateTime extends DateTime { public static function createFromFormat(string $format, string $time, DateTimeZone $timezone = null) { return parent::createFromFormat($format, $time, $timezone); } }
Output for 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Deprecated: Return type of My_DateTime::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/3Bs7U on line 5
Output for 8.0.0 - 8.0.30
Output for 7.4.0 - 7.4.33
Warning: Declaration of My_DateTime::createFromFormat(string $format, string $time, ?DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, ?DateTimeZone $object = NULL) in /in/3Bs7U on line 5
Output for 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
Warning: Declaration of My_DateTime::createFromFormat(string $format, string $time, ?DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, ?DateTimeZone $object = NULL) in /in/3Bs7U on line 9
Output for 7.1.0 - 7.1.33
Warning: Declaration of My_DateTime::createFromFormat(string $format, string $time, ?DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/3Bs7U on line 9
Output for 7.0.0 - 7.0.20
Warning: Declaration of My_DateTime::createFromFormat(string $format, string $time, DateTimeZone $timezone = NULL) should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/3Bs7U on line 9
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Strict Standards: Declaration of My_DateTime::createFromFormat() should be compatible with DateTime::createFromFormat($format, $time, $object = NULL) in /in/3Bs7U on line 9

preferences:
177.8 ms | 402 KiB | 224 Q