3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Foo { public function foo(\DateTime $date = null); } class Bar implements Foo { public function foo() { return 'foo'; } }
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Fatal error: Declaration of Bar::foo() must be compatible with Foo::foo(?DateTime $date = null) in /in/a8u5l on line 8
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Fatal error: Declaration of Bar::foo() must be compatible with Foo::foo(?DateTime $date = NULL) in /in/a8u5l on line 8
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33
Fatal error: Declaration of Bar::foo() must be compatible with Foo::foo(?DateTime $date = NULL) in /in/a8u5l on line 7
Process exited with code 255.
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33
Fatal error: Declaration of Bar::foo() must be compatible with Foo::foo(DateTime $date = NULL) in /in/a8u5l on line 7
Process exited with code 255.

preferences:
191.85 ms | 402 KiB | 292 Q