Quick Answer
Reflection API inspects classes, methods, properties, and parameters at runtime. Use ReflectionClass to get class metadata, list methods, read annotations/attributes. Useful in DI containers (auto-resolve constructor params), testing frameworks (access private members), ORM mappers, and plugin systems. Powerful but slow - cache reflection results in production. Avoid in hot paths.
Answer
Reflection inspects classes, methods, and parameters. Useful for dependency injection containers and ORMs.
S
SugharaIQ Editorial Team
Verified Answer
This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.
PHP interview questions and answers for beginner, junior, mid-level, senior, and expert developers. Ideal for freshers and experienced candidates preparing for PHP roles.