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(); } } interface 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 gZgoi
Output for 7.0.0 - 7.2.0
Fatal error: Class 'BarAbstract' not found in /in/ADAl3 on line 36
Process exited with code 255.
Output for 5.3.19 - 5.6.28
Fatal error: Class 'BarAbstract' not found in /in/ADAl3 on line 37
Process exited with code 255.