What is the output of the following code?function z($x) {return function ($y) use ($x) {return str_repeat($y, $x);};}$a = z(2);$b = z(3);echo $a(3) . $b(2);
Answer(s): B
What is the output of the following code?$f = function () { return "hello"; };echo gettype($f);
Answer(s): C
What is the output of the following code?class C {public $x = 1;function __construct() { ++$this->x; }function __invoke() { return ++$this->x; }function __toString() { return (string) --$this->x; }}$obj = new C();echo $obj();
Answer(s): D
CORRECT TEXTConsider the following code. Which keyword should be used in the line marked with "KEYWORD" instead of "self" to make this code work as intended?abstract class Base {protected function __construct() {}public static function create() {return new self(); // KEYWORD}abstract function action();}class Item extends Base {public function action() { echo __CLASS__; }}$item = Item::create();$item->action(); // outputs "Item"
Answer(s): A
Post your Comments and Discuss Zend 200-550 exam with other Community members:
To protect our content from bots for real learners like you, we ask you to register for free. Sign in or sign up now to continue with the 200-550 material!