Zend-Technologies Zend Certified PHP Engineer (200-550) Free Practice Test
Question 1
Which MIME type is always sent by a client if a JPEG file is uploaded via HTTP?
Correct Answer: A
Question 2
Which of the following PHP functions can be used to set the HTTP response code? (Choose 2)
Correct Answer: A,D
Question 3
When a browser requests an image identified by an img tag, it never sends a Cookie header.
Correct Answer: A
Question 4
CORRECT TEXT
What is the output of the following code?
function increment (&$val)
{
return $val + 1; }
$a = 1;
echo increment ($a); echo increment ($a);
What is the output of the following code?
function increment (&$val)
{
return $val + 1; }
$a = 1;
echo increment ($a); echo increment ($a);
Correct Answer:
22
Question 5
What parsing methodology is utilized by the SimpleXML extension?
Correct Answer: C
Question 6
What is the recommended method of copying data between two opened files?
Correct Answer: D
Question 7
Consider the following XML code:
<?xml version="1.0" encoding="utf-8"?>
<books>
<book id="1">PHP 5.5 in 42 Hours</book>
<book id="2">Learning PHP 5.5 The Hard Way</book> </books>
Which of the following SimpleXML calls prints the name of the second book? (Let $xml = simplexml_load_file("books.xml"); .) (Choose 2)
<?xml version="1.0" encoding="utf-8"?>
<books>
<book id="1">PHP 5.5 in 42 Hours</book>
<book id="2">Learning PHP 5.5 The Hard Way</book> </books>
Which of the following SimpleXML calls prints the name of the second book? (Let $xml = simplexml_load_file("books.xml"); .) (Choose 2)
Correct Answer: C,E
Question 8
Which methods can be used to overload object properties? (Choose 2)
Correct Answer: A,D
Question 9
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: C
Question 10
What is the output of the following code? var_dump(boolval([]));
Correct Answer: A
Question 11
CORRECT TEXT
Which SPL class implements fixed-size storage?
Which SPL class implements fixed-size storage?
Correct Answer:
SplFixedArray
Question 12
CORRECT TEXT
What is the name of the key for the element in $_FILES['name'] that contains the provisional name of the uploaded file?
What is the name of the key for the element in $_FILES['name'] that contains the provisional name of the uploaded file?
Correct Answer:
tmp_name
Question 13
Which of the following statements are FALSE?
Correct Answer: A
Question 14
What is the return value of the following code?
strpos("me myself and I", "m", 2)
strpos("me myself and I", "m", 2)
Correct Answer: B
Question 15
CORRECT TEXT
What is the name of the key in $_FILES['name'] that contains the number of bytes of the uploaded file?
What is the name of the key in $_FILES['name'] that contains the number of bytes of the uploaded file?
Correct Answer:
size
Question 16
Transactions should be used to: (Choose 2)
Correct Answer: C,D
Question 17
Assuming UTF-8 encoding, what is the value of $count?
$data = '$1A2'; $count = strlen($data);
$data = '$1A2'; $count = strlen($data);
Correct Answer: D