we provide Validated Zend Technologies 200-550 book which are the best for clearing 200-550 test, and to get certified by Zend Technologies Zend Certified PHP Engineer. The 200-550 Questions & Answers covers all the knowledge points of the real 200-550 exam. Crack your Zend Technologies 200-550 Exam with latest dumps, guaranteed!
Q65. Under what condition may HTTP headers be set from PHP if there is content echoed prior to the header function being used?
A. headers_sent() returns true
B. Output buffering is enabled
C. The client supports local buffering
D. The webserver uses preemptive mode
Answer: B
Q66. What is the output of the following code? var_dump(boolval(new StdClass()));
A. bool(true)
B. bool(false)
Answer: A
Q67. 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 $this->v[$v];
}
}
$m = new Magic();
$m->d[] = 4;
echo $m->d[0];
A. Nothing, this code works just fine.
B. Add set method doing $this->v[$var] = $val
C. Rewrite get as: public function get(&$v)
D. Rewrite get as: public function & get($v)
E. Make get method static
Answer: D
Q68. How do you allow the caller to submit a variable number of arguments to a function?
A. Using a prototype like function test(... $parameters).
B. Using a prototype like function test() and the function func_get_args() inside the function body.
C. Using a prototype like function test($parameters[]).
D. Using a prototype like function test() and the function get_variable_args() inside the function body.
E. This is not possible in PHP.
Answer: B
Q69. Assuming UTF-8 encoding, what is the value of $count?
$data = '$1Ä2'
$count = strlen($data);
A. 0
B. 4
C. 5
D. 7
Answer: C
Q70. What will the $array array contain at the end of this script?
function modifyArray (&$array)
{
foreach ($array as &$value)
{
$value = $value + 1;
}
$value = $value + 2;
}
$array = array (1, 2, 3); modifyArray($array);
A. 2, 3, 4
B. 2, 3, 6
C. 4, 5, 6
D. 1, 2, 3
Answer: B
Q71. An HTML form contains this form element:
<input type="file" name="myFile" />
When this form is submitted, the following PHP code gets executed: move_uploaded_file(
$_FILES['myFile']['tmp_name'], 'uploads/' . $_FILES['myFile']['name']
);
Which of the following actions must be taken before this code may go into production? (Choose 2)
A. Check with is_uploaded_file() whether the uploaded file $_FILES['myFile']['tmp_name'] is valid
B. Sanitize the file name in $_FILES['myFile']['name'] because this value is not consistent among web browsers
C. Check the charset encoding of the HTTP request to see whether it matches the encoding of the uploaded file
D. Sanitize the file name in $_FILES['myFile']['name'] because this value could be forged
E. Use $HTTP_POST_FILES instead of $_FILES to maintain upwards compatibility
Answer: B,D
Q72. Which of the following is NOT true about PHP traits? (Choose 2)
A. Multiple traits can be used by a single class.
B. A trait can implement an interface.
C. A trait can declare a private variable.
D. Traits are able to be auto-loaded.
E. Traits automatically resolve conflicts based on definition order.
Answer: B,E
Q73. Which php.ini setting is usually required to use an opcode cache?
A. extension
B. zend_extension
C. optimizer
D. dl
Answer: B
Q74. 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. false-false
B. false-true
C. true-false
D. true-true
Answer: B
Q75. Which of the following statements is true?
A. All PHP database extensions support prepared statements
B. All PHP database extensions come with their own special helper functions to escape user data to be used in dynamic SQL queries
C. All PHP database extensions provide an OOP interface
D. All PHP database extensions appear in the output of php -m , if installed and enabled
Answer: D
Q76. CORRECT TEXT
Consider the following code:
$result = $value1 ??? $value2;
Which operator needs to be used instead of ??? so that $result equals $value1 if $value1 evaluates to true, and equals $value2 otherwise? Just state the operator as it would be required in the code.
Answer: ?:
Q77. Which of the following can be registered as entry points with a SoapServer instance (choose 2):
A. A single function
B. A single method from a class
C. All methods from a class
D. All classes defined in a script
Answer: A,C
Q78. CORRECT TEXT
What is the output of the following code?
function increment ($val)
{
$_GET['m'] = (int) $_GET['m'] + 1;
}
$_GET['m'] = 1;
echo $_GET['m'];
Answer: 1
Q79. The following form is loaded in a recent browser and submitted, with the second select option selected:
<form method="post">
<select name="list">
<option>one</option>
<option>two</option>
<option>three</option>
</select>
</form>
In the server-side PHP code to deal with the form data, what is the value of $_POST['list'] ?
A. 1
B. 2
C. two
D. null
Answer: C
Q80. You want to access the 3rd character of a string, contained in the variable $test. Which of the following possibilites work? (Choose 2)
A. echo $test(3);
B. echo $test[2];
C. echo $test(2);
D. echo $test{2};
E. echo $test{3};
Answer: B,D