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.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
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:
45.55 ms | 402 KiB | 63 Q