А
Size: a a a
D
А
final class ServiceB
{
public function do()
{
return 1;
}
}
final class ServiceA
{
private $b;
public function __construct(ServiceB $b)
{
$this->b = $b;
}
public function some()
{
return $this->b->do();
}
}
(new ReflectionClass(ServiceA::class))->newInstanceWithoutConstructor()->some(); // Uncaught Error: Call to a member function do() on null
AD
final class ServiceB
{
public function do()
{
return 1;
}
}
final class ServiceA
{
private $b;
public function __construct(ServiceB $b)
{
$this->b = $b;
}
public function some()
{
return $this->b->do();
}
}
(new ReflectionClass(ServiceA::class))->newInstanceWithoutConstructor()->some(); // Uncaught Error: Call to a member function do() on null
D
final class ServiceB
{
public function do()
{
return 1;
}
}
final class ServiceA
{
private $b;
public function __construct(ServiceB $b)
{
$this->b = $b;
}
public function some()
{
return $this->b->do();
}
}
(new ReflectionClass(ServiceA::class))->newInstanceWithoutConstructor()->some(); // Uncaught Error: Call to a member function do() on null
А
А
AD
А