Quick Answer
A callback is a function passed as an argument to another function. PHP accepts closures, arrow functions, function name strings, or array with object+method. Used with array_map(), array_filter(), usort(), etc. Callbacks let you customize behavior without changing the function. Closures can capture outer variables using the use keyword.
Answer
A callback is a function passed as an argument and executed inside another function.
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.