Interfaces let you write code that depends on an abstraction rather than a concrete class. Any implementation that satisfies the contract can be substituted — the foundation of Dependency Injection and unit testing.
interface Logger {
public function log(string $message): void;
}
class FileLogger implements Logger { ... }
class NullLogger implements Logger { ... }