Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Cannot use traits inside of interfaces. %s is used in %s

Description

The command use cannot be used in an interface to include a trait. The trait must be included at the class level, or in another trait.

Example

<?php

interface I {
    use T;
}

?>

Literal Examples

  • Cannot use traits inside of interfaces. T is used in I

Alternatives

  • Use the trait in the target classes.