Zend
200-710 · Question #112
Which of the following statements about anonymous functions in PHP are NOT true? (Choose 2)
The correct answer is B. Anonymous functions created within object context are always bound to that object C. Assigning closure to a property of an object binds it to that object. See the full explanation below for the reasoning.
Closures
Question
Which of the following statements about anonymous functions in PHP are NOT true? (Choose 2)
Options
- AAnonymous functions can be bound to objects
- BAnonymous functions created within object context are always bound to that object
- CAssigning closure to a property of an object binds it to that object
- DMethods bind() and bindTo() of the Closure object provide means to create closures with different binding and scope
- EBinding defines the value of $this and the scope for a closure
How the community answered
(57 responses)- A7% (4)
- B75% (43)
- D4% (2)
- E14% (8)
Topics
#anonymous functions#closure binding#object scope#Closure methods
Community Discussion
No community discussion yet for this question.