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 {}
Output for 8.1.0 - 8.1.29, 8.2.0 - 8.2.21, 8.3.0 - 8.3.9
Output for 7.3.31
Fatal error: Declaration of ChildType::accept(ChildVisitor $visitor): mixed must be compatible with ParentType::accept(ParentVisitor $visitor): mixed in /in/O7F8n on line 12
Process exited with code 255.

preferences:
85.24 ms | 403 KiB | 68 Q