3v4l.org

run code in 500+ PHP versions simultaneously
<?php class MyDateTime extends DateTime { public function modify(string $modifier) { return false; } }
Output for 8.0.0 - 8.0.30
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
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 8.1.0 - 8.1.34, 8.2.0 - 8.2.34, 8.3.0 - 8.3.35
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.4.1 - 8.4.26, 8.5.0 - 8.5.11
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

preferences:
38.64 ms | 1151 KiB | 15 Q