1.2.1261. Undefined Trait¶
Those are undefined, traits .
When the using class or trait is instantiated, PHP emits a a fatal error.
Trait which are referenced in a use expression are omitted: they are considered part of code that is probably outside the current code, either omitted or in external component.
<?php
use Composer/Component/someTrait as externalTrait;
trait t {
function foo() {}
}
// This class uses trait that are all known
class hasOnlyDefinedTrait {
use t, externalTrait;
}
// This class uses trait that are unknown
class hasUndefinedTrait {
use unknownTrait, t, externalTrait;
}
?>