zend 200-550 practice test

Zend Framework 2

Last exam update: Nov 18 ,2025
Page 1 out of 15. Viewing questions 1-15 out of 221

Question 1

What is the output of the following code?
echo '1' . (print '2') + 3;

  • A. 123
  • B. 213
  • C. 142
  • D. 214 E: Syntax error
Mark Question:
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 2

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. one
  • B. two
  • C. three
  • D. four
Mark Question:
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 3

What is "instanceof" an example of?

  • A. a boolean
  • B. an operator
  • C. a function
  • D. a language construct E: a class magic
Mark Question:
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 4

Which of the following may be used in conjunction with CASE inside a SWITCH statement?

  • A. A scalar
  • B. An expression
  • C. A boolean
  • D. All of the above
Mark Question:
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 5

What is the output of the following code?
$a = 'a'; $b = 'b';
echo isset($c) ? $a.$b.$c : ($c = 'c').'d';

  • A. abc
  • B. cd
  • C. 0d
Mark Question:
Answer:

B

User Votes:
A
50%
B
50%
C
50%
Discussions
vote your answer:
A
B
C
0 / 1000

Question 6

Which of the following are valid identifiers? (Choose 3)

  • A. function 4You() { }
  • B. function _4You() { }
  • C. function object() { }
  • D. $1 = "Hello";
  • E. $_1 = "Hello World";
Mark Question:
Answer:

B, C, E

User Votes:
A
50%
B
50%
C
50%
D
50%
E
50%
Discussions
vote your answer:
A
B
C
D
E
0 / 1000

Question 7

What super-global should be used to access information about uploaded files via a POST request?

  • A. $_SERVER
  • B. $_ENV
  • C. $_POST
  • D. $_FILES E: $_GET
Mark Question:
Answer:

D

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 8

What is the difference between "print" and "echo"?

  • A. There is no difference.
  • B. Print has a return value, echo does not
  • C. Echo has a return value, print does not
  • D. Print buffers the output, while echo does not E: None of the above
Mark Question:
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 9

What is the output of the following code?
echo "1" + 2 * "0x02";

  • A. 1
  • B. 3
  • C. 5
  • D. 20 E: 7
Mark Question:
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 10

What is the result of the following bitwise operation in PHP?
1 ^ 2

  • A. 1
  • B. 3
  • C. 2
  • D. 4 E: -1
Mark Question:
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 11

What is the output of the following code?
echo "22" + "0.2", 23 . 1;

  • A. 220.2231
  • B. 22.2231
  • C. 22.2,231
  • D. 56.2
Mark Question:
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 12

What is the output of the following code?
$first = "second";
$second = "first";
echo $$$first;

  • A. "first"
  • B. "second"
  • C. an empty string
  • D. an error
Mark Question:
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 13

What is the output of the following code?
$first = "second";
$second = "first";
echo $$$first;

  • A. "first"
  • B. "second"
  • C. an empty string
  • D. an error
Mark Question:
Answer:

B

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 14

Which of the following code snippets DO NOT write the exact content of the file "source.txt" to
"target.txt"? (Choose 2)

  • A. file_put_contents("target.txt", fopen("source.txt", "r"));
  • B. file_put_contents("target.txt", readfile("source.txt"));
  • C. file_put_contents("target.txt", join(file("source.txt"), "\n"));
  • D. file_put_contents("target.txt", file_get_contents("source.txt")); E: $handle = fopen("target.txt", "w+"); fwrite($handle, file_get_contents("source.txt")); fclose($handle);
Mark Question:
Answer:

B, C

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000

Question 15

What is the recommended method of copying data between two opened files?

  • A. copy($source_file, $destination_file);
  • B. copy($destination_file, $source_file);
  • C. stream_copy_to_stream($source_file, $destination_file);
  • D. stream_copy_to_stream($destination_file, $source_file); E: stream_bucket_prepend($source_file, $destination_file);
Mark Question:
Answer:

C

User Votes:
A
50%
B
50%
C
50%
D
50%
Discussions
vote your answer:
A
B
C
D
0 / 1000
To page 2