<?php interface ContainerInterface1 { public function get($id); } interface ContainerInterface2 { public function get($id, $params = [], $setters = [], $shared = true); } class Container implements ContainerInterface1, ContainerInterface2 { public function get($id, $params = [], $setters = [], $shared = true) { return $id; } } class Y { public function setContainer(ContainerInterface1 $value) { $this->value = $value; } } $container = new Container(); var_dump($container instanceof ContainerInterface1); var_dump($container instanceof ContainerInterface2); echo $container->get('hello'); $y = new Y(); $y->setContainer($container);
You have javascript disabled. You will not be able to edit any code.