Zend-Technologies Zend Certified Engineer (200-710) Free Practice Test
Question 1
Which of the following filtering techniques prevents all cross-site scripting (XSS) vulnerabilities?
Correct Answer: C
Question 2
The following form is loaded in a browser and submitted, with the checkbox activated:
<form method="post">
<input type="checkbox" name="accept" />
</form>
In the server-side PHP code to deal with the form data, what is the value of $_POST['accept'] ?
<form method="post">
<input type="checkbox" name="accept" />
</form>
In the server-side PHP code to deal with the form data, what is the value of $_POST['accept'] ?
Correct Answer: B
Question 3
Which of these statements about PDO is NOT true?
Correct Answer: A
Question 4
Given the following code, how can we use both traits A and Bin the same class? (select all that apply)
trait A {
public function hello() {
return "hello";
}
public function world() {
return "world";
}
}
trait B {
public function hello() {
return "Hello";
}
public function person($name) {
return ":$name";
trait A {
public function hello() {
return "hello";
}
public function world() {
return "world";
}
}
trait B {
public function hello() {
return "Hello";
}
public function person($name) {
return ":$name";
Correct Answer: A
Question 5
In the following code, which classes can be instantiated?
abstract class Graphics {
abstract function draw($im, $col);
}
abstract class Point1 extends Graphics {
public $x, $y;
}
function _construct($x, $y) {
$ this->x = $x;
$ this->y = $y;
}
function draw($im, $col) {
lmageSetPixel($im, $this->x, $this->y, $col);
}
class Point2 extends Point1 {}
abstract class Point3 extends Point2 {}
abstract class Graphics {
abstract function draw($im, $col);
}
abstract class Point1 extends Graphics {
public $x, $y;
}
function _construct($x, $y) {
$ this->x = $x;
$ this->y = $y;
}
function draw($im, $col) {
lmageSetPixel($im, $this->x, $this->y, $col);
}
class Point2 extends Point1 {}
abstract class Point3 extends Point2 {}
Correct Answer: B
Question 6
Consider the following code. What change must be made to the class for the code to work as written?
class Magic {
}
protected $v = array("a" => 1, "b" => 2, "c" => 3);
public function _get($v) {
return $th is->v[$v ];
$ m = new Magic();
$ m->d[] = 4;
echo $m->d[O];
class Magic {
}
protected $v = array("a" => 1, "b" => 2, "c" => 3);
public function _get($v) {
return $th is->v[$v ];
$ m = new Magic();
$ m->d[] = 4;
echo $m->d[O];
Correct Answer: E
Question 7
What is the name of the key in $_FILES['name'] that contains the number of bytes of the uploaded file?
Correct Answer:
size
Question 8
What is the result of the following code?
class T
canst A = 42 + 1;
}
echoT::A;
class T
canst A = 42 + 1;
}
echoT::A;
Correct Answer: B
Question 9
What does the _FILE_ constant contain?
Correct Answer: C
Question 10
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
Question 11
After performing the following operations:
$ a= array('a', 'b', 'c');
$ a= array_keys(array_flip($a));
What will be the value of $a?
$ a= array('a', 'b', 'c');
$ a= array_keys(array_flip($a));
What will be the value of $a?
Correct Answer: B
Question 12
Which of these error types may be handled by a user defined error handler function? {Choose two.)
Correct Answer: A,C
Question 13
What is the output of this code?
$ world = 'world';
echo <<<'TEXT'
hello $world
TEXT;
$ world = 'world';
echo <<<'TEXT'
hello $world
TEXT;
Correct Answer: B