3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class Foo { protected $bar; public function __construct(BarInterface $bar) { $this->bar = $bar; } public function doAction() { $bar->getVar(); } } class BarInterface { public function getVar() {} } abstract class BarAbscract implements BarInterface { public function getVar() { return $this->var; } } class Bar extends BarAbscract { protected $var = __CLASS__; } class Baz extends BarAbstract { protected $var = __CLASS__; } $bar = new Bar(); $foo = new Foo($bar); $foo->doAction();
based on 99uCH
Output for 7.0.0 - 7.2.0
Fatal error: BarAbscract cannot implement BarInterface - it is not an interface in /in/ihI1k on line 22
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: BarAbscract cannot implement BarInterface - it is not an interface in /in/ihI1k on line 23
Process exited with code 255.