Zend
200-550 · Question #19
Which line of code can be used to replace the INSERT comment in order to output "hello"? class C { public $ello = 'ello'; public $c; public $m; function __construct($y) { $this->c = static…
The correct answer is B. return $f() . "ello". See the full explanation below for the reasoning.
Question
Which line of code can be used to replace the INSERT comment in order to output "hello"? class C { public $ello = 'ello'; public $c; public $m; function __construct($y) { $this->c = static function($f) { // INSERT LINE OF CODE HERE }; $this->m = function() { return "h"; }; } } $x = new C("h"); $f = $x->c; echo $f($x->m);
Options
- Areturn $this->m() . "ello";
- Breturn $f() . "ello";
- Creturn "h". $this->ello;
- Dreturn $y . "ello";
How the community answered
(36 responses)- A14% (5)
- B75% (27)
- C6% (2)
- D6% (2)
Community Discussion
No community discussion yet for this question.