<?php
class DEP1{}
class DEP2{}
class DEP3{}
interface A{
function get1(): DEP1;
function get2(): DEP2;
function get3(): DEP3;
}
class AImpl implements A{
function __construct(A $DEP){
$this->x = $DEP->get1();
$this->y = $DEP->get2();
$this->z = $DEP->get3();
}
function get1(): DEP1{
return $this->x;
}
function get2(): DEP2{
return $this->y;
}
function get3(): DEP3{
return $this->z;
}
}
new AImpl(new class() implements A{
function get1(): DEP1{ return new DEP1; }
function get2(): DEP2{ return new DEP2; }
function get3(): DEP3{ return new DEP3; }
});
Deprecated: Creation of dynamic property AImpl::$x is deprecated in /in/XdBiJ on line 15
Deprecated: Creation of dynamic property AImpl::$y is deprecated in /in/XdBiJ on line 16
Deprecated: Creation of dynamic property AImpl::$z is deprecated in /in/XdBiJ on line 17