What is SOLID in PHP?
Answer
SOLID is a set of five OOP design principles. S — Single Responsibility: a class should have one reason to change (one job). O — Open/Closed: open for extension, closed for modification — use interfaces and abstractions to add behavior without editing existing code. L — Liskov Substitution: subclasses must be substitutable for their parent classes without changing the correctness of the program — honor the parent's contract. I — Interface Segregation: prefer small, specific interfaces over large, general ones — clients should not be forced to implement methods they do not use. D — Dependency Inversion: high-level modules should not depend on low-level modules — both should depend on abstractions (interfaces). Following SOLID produces loosely coupled, easily testable, and maintainable PHP code.