3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MyDateTime extends DateTime { public function modify(string $modifier) { return false; } }
Output for 8.4.1 - 8.4.18, 8.5.0 - 8.5.3
Deprecated: Return type of MyDateTime::modify(string $modifier) should either be compatible with DateTime::modify(string $modifier): DateTime, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/5WH2c on line 5
Output for 8.1.0 - 8.1.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30
Deprecated: Return type of MyDateTime::modify(string $modifier) should either be compatible with DateTime::modify(string $modifier): DateTime|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /in/5WH2c on line 5
Output for 8.0.0 - 8.0.30
Output for 7.4.0 - 7.4.33
Warning: Declaration of MyDateTime::modify(string $modifier) should be compatible with DateTime::modify($modify) in /in/5WH2c on line 5
Output for 7.3.0 - 7.3.33
Warning: Declaration of MyDateTime::modify(string $modifier) should be compatible with DateTime::modify($modify) in /in/5WH2c on line 6

preferences:
74.51 ms | 1415 KiB | 4 Q