I am facing an unexpected behaviour trying to use the following:
$object instanceof $class
1/ PHP \'instanceof\' keyword and namespaces wor
You should use ReflectionClass to avoid any execution or behaviours you have in\on this model. Read more aboit ReflectionClass to get more info about class\model we checking. http://php.net/manual/en/class.reflectionclass.php
foreach ($this->modelNamespaces as $namespace) {
$reflectionClass = new \ReflectionClass($namespace);
if ($reflectionClass->implementsInterface('common\models\FieldsInCollectionInterface')) {
// class is implemented by FieldsInCollectionInterface
}
}