- var_dump: documentation ( source)
<?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());