Интерфейс - контракт, описывающий набор методов без реализации:
interface Cacheable {
public function getCacheKey(): string;
public function getCacheTTL(): int;
}
class User implements Cacheable {
public function getCacheKey(): string { return "user:{$this->id}"; }
public function getCacheTTL(): int { return 3600; }
}Различия от абстрактных классов: