Zend
200-710 · Question #35
What is the output of the following code? $f = function () { return "hello"; }; echo gettype($f);
The correct answer is C. object. See the full explanation below for the reasoning.
Closures
Question
What is the output of the following code?
$f = function () { return "hello"; };
echo gettype($f);
Options
- Ahello
- Bstring
- Cobject
- Dfunction
How the community answered
(43 responses)- A16% (7)
- B5% (2)
- C70% (30)
- D9% (4)
Topics
#gettype#closure type#object type#anonymous functions
Community Discussion
No community discussion yet for this question.