3v4l.org

run code in 300+ PHP versions simultaneously
<?php interface ChildVisitor { /* some visiting methods */ } interface ParentVisitor extends ChildVisitor { /* some extra visiting methods */ } interface ParentType { public function accept(ParentVisitor $visitor) : mixed; } interface ChildType extends ParentType { public function accept(ChildVisitor $visitor) : mixed; } interface OtherInterface extends ParentType {} interface InterfaceOrClass extends ChildType, OtherInterface {}
based on nc3qR
Output for 7.4.0 - 7.4.16, 8.0.0 - 8.0.3
Output for 7.3.0 - 7.3.27
Fatal error: Declaration of ChildType::accept(ChildVisitor $visitor): mixed must be compatible with ParentType::accept(ParentVisitor $visitor): mixed in /in/7u3Pn on line 12
Process exited with code 255.