3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface A { public function foo($a); } class B implements A { public function foo(A $a = null) {} }
based on dpEX2
Output for 7.1.0 - 7.2.0
Fatal error: Declaration of B::foo(?A $a = NULL) must be compatible with A::foo($a) in /in/L6YHp on line 4
Process exited with code 255.
Output for 7.0.0 - 7.0.20
Fatal error: Declaration of B::foo(A $a = NULL) must be compatible with A::foo($a) in /in/L6YHp on line 4
Process exited with code 255.
Output for 5.4.0 - 5.6.28
Fatal error: Declaration of B::foo() must be compatible with A::foo($a) in /in/L6YHp on line 4
Process exited with code 255.
Output for 5.3.19 - 5.3.29
Fatal error: Declaration of B::foo() must be compatible with that of A::foo() in /in/L6YHp on line 4
Process exited with code 255.