Zend-Technologies Zend Certified Engineer - 200-710 Exam Practice Test
What is the output of the following code?
$ a= array('a', 'b'=>'c');
echo property_exists((object) $a, 'a')?'true':'false';
echo'-';
echo property_exists((object) $a, 'b')?'true':'false';
$ a= array('a', 'b'=>'c');
echo property_exists((object) $a, 'a')?'true':'false';
echo'-';
echo property_exists((object) $a, 'b')?'true':'false';
Correct Answer: A
Vote an answer
What is the output of the following code?
class Number {
private $v = 0;
public function _construct($v) { $this->v = $v; }
public function mul() {
return function ($x) { return $this->v * $x; };
$ one = new Number(l);
$ two= new Number(2);
$ double = $two->mul()->bindTo($one);
echo $double(S);
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{l);
$ two= new Number(2);
$ double = $two->mul();
$ x = Closure::bind($double, null, 'Number');
echo $x(5);
class Number {
private $v = 0;
public function _construct($v) { $this->v = $v; }
public function mul() {
return function ($x) { return $this->v * $x; };
$ one = new Number(l);
$ two= new Number(2);
$ double = $two->mul()->bindTo($one);
echo $double(S);
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{l);
$ two= new Number(2);
$ double = $two->mul();
$ x = Closure::bind($double, null, 'Number');
echo $x(5);
Correct Answer:
5
How can a SimpleXML object be converted to a DOM object?
Correct Answer: E
Vote an answer
What is the output of the following code?
try {
}
class MyException extends Exception {};
try {
throw new MyException;
}
catch (Exception $e) {
echo "1:";
throw $e;
}
catch (MyException $e) {
echo "2:";
throw $e;
}
catch (Exception $e) {
echo get_class($e);
}
try {
}
class MyException extends Exception {};
try {
throw new MyException;
}
catch (Exception $e) {
echo "1:";
throw $e;
}
catch (MyException $e) {
echo "2:";
throw $e;
}
catch (Exception $e) {
echo get_class($e);
}
Correct Answer: D
Vote an answer
What is the output of the following code?
$ a= 3;
switch ($a) {
}
case 1: echo 'one'; break;
case 2: echo 'two'; break;
default: echo 'four'; break;
case 3: echo 'three'; break;
$ a= 3;
switch ($a) {
}
case 1: echo 'one'; break;
case 2: echo 'two'; break;
default: echo 'four'; break;
case 3: echo 'three'; break;
Correct Answer: B
Vote an answer
Which of the following is NOT true about PHP traits? (Choose 2)
Correct Answer: B,D
Vote an answer
Which of the following rules must every correct XML document adhere to? (Choose 2)
Correct Answer: A,B
Vote an answer
What is the output of the following code?
class A {
public $a= 1;
public function _construct($a) { $this->a = $a; }
public function mul() {
}
return function($x) {
return $this->a*$x;
};
$ a= new A(2);
$ a->mul = function($x) {
return $x*$x;
};
$ m = $a->mul();
echo $m(3);
class A {
public $a= 1;
public function _construct($a) { $this->a = $a; }
public function mul() {
}
return function($x) {
return $this->a*$x;
};
$ a= new A(2);
$ a->mul = function($x) {
return $x*$x;
};
$ m = $a->mul();
echo $m(3);
Correct Answer: B
Vote an answer
What would be the output ofthe following code?
namespace MyFramework\DB;
class MyClass {
static function myName() {
return _METHOD_;
}
print MyClass::myName();
namespace MyFramework\DB;
class MyClass {
static function myName() {
return _METHOD_;
}
print MyClass::myName();
Correct Answer: B
Vote an answer
Which PHP function is used to validate whether the contents of $_FILES['name']['tmp_name'] have really
been uploaded via HTIP?
been uploaded via HTIP?
Correct Answer:
is_uploaded_file(), is_uploaded_file
Which of the following items in the $_SERVER super global are important for authenticating the client
when using HTTP Basic authentication? (Choose 2)
when using HTTP Basic authentication? (Choose 2)
Correct Answer: A,B
Vote an answer
What is the name of the PHP function used to automatically load non-yet defined classes?
Correct Answer: A
Vote an answer
Which methods can be used to overload object properties? (Choose 2)
Correct Answer: A,D
Vote an answer
Which of the following techniques ensures that a value submitted in a form can only be yes or no?
Correct Answer: C
Vote an answer
Which of the following parts must a XML document have in order to be well-formed?
Correct Answer: B
Vote an answer
What can prevent PHP from being able to open a file on the hard drive (Choose 2)?
Correct Answer: A,B
Vote an answer