3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php interface IA { public function compare(self $x); } interface IAChild extends IA {} class A implements IA { public function compare(IA $x) {} } class AA implements IAChild { public function compare(IAChild $x){} } $a = new A; $aa = new AA; $a->compare($a); $a->compare($aa);
Output for 7.0.0 - 7.3.0rc4
Fatal error: Declaration of AA::compare(IAChild $x) must be compatible with IA::compare(IA $x) in /in/ODkTf on line 14
Process exited with code 255.
Output for 5.4.12 - 5.6.28
Fatal error: Declaration of AA::compare() must be compatible with IA::compare(IA $x) in /in/ODkTf on line 14
Process exited with code 255.
Output for 5.3.22 - 5.3.29
Fatal error: Declaration of A::compare() must be compatible with that of IA::compare() in /in/ODkTf on line 10
Process exited with code 255.