- Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.25, 8.3.0 - 8.3.14
- object(FooChild)#2 (0) { }
<?php
class FooParent {}
class FooChild extends FooParent {};
interface BarInterface {
public function getProvider(): FooParent;
}
class BarImplementation {
public function getProvider(): FooChild {
return new FooChild();
}
}
$a = new BarImplementation();
var_dump($a->getProvider());