3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface Foo { public function render(bool $x = null); } class X implements Foo { public function render(bool $x = false) { var_dump($x); } } (new X())->render();
Output for 8.4.1 - 8.4.12
Deprecated: Foo::render(): Implicitly marking parameter $x as nullable is deprecated, the explicit nullable type must be used instead in /in/KuM1M on line 5 Fatal error: Declaration of X::render(bool $x = false) must be compatible with Foo::render(?bool $x = null) in /in/KuM1M on line 10
Process exited with code 255.
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.25
Fatal error: Declaration of X::render(bool $x = false) must be compatible with Foo::render(?bool $x = null) in /in/KuM1M on line 10
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Fatal error: Declaration of X::render(bool $x = false) must be compatible with Foo::render(?bool $x = NULL) in /in/KuM1M on line 10
Process exited with code 255.
Output for 7.3.0 - 7.3.33
Fatal error: Declaration of X::render(bool $x = false) must be compatible with Foo::render(?bool $x = NULL) in /in/KuM1M on line 8
Process exited with code 255.

preferences:
136.74 ms | 410 KiB | 5 Q