nerdexam
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)
  • A
    16% (7)
  • B
    5% (2)
  • C
    70% (30)
  • D
    9% (4)

Topics

#gettype#closure type#object type#anonymous functions

Community Discussion

No community discussion yet for this question.

Full 200-710 Practice