What is the output of the following code? class Number { private $v; private static $sv = 10; public function __construct($v) { $this->v = $v; } public function mul() { return static function ($x) { return isset($this) ? $this->v*$x : self::$sv*$x; }; } } $one = new Number(1); $two = new Number(2); $double = $two->mul(); $x = Closure::bind($double, null, 'Number'); echo $x(5);

🎲 Try a Random Question  |  Total Questions in Quiz: 125  |  🧠 Study this quiz with Flashcards
This question is part of a full practice quiz:
200-550: Zend Certified PHP Engineer Exam Practice Test 2 — practice the complete quiz, review flashcards, or try a random question.


What is the output of the following code? class Number { private $v; private static $sv = 10; public function __construct($v) { $this->v = $v; } public function mul() { return static function ($x) { return isset($this) ? $this->v*$x : self::$sv*$x; }; } } $one = new Number(1); $two = new Number(2); $double = $two->mul(); $x = Closure::bind($double, null, 'Number'); echo $x(5);