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.5.0 - 8.5.3
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 Stack trace: #0 {main}
Process exited with code 255.
Output for 8.4.1 - 8.4.18
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.34, 8.2.0 - 8.2.30, 8.3.0 - 8.3.30
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:
95.37 ms | 1390 KiB | 4 Q