Exam Code: 200-530 (Practice Exam Latest Test Questions VCE PDF)
Exam Name: Zend PHP 5.3 Certification
Certification Provider: Zend Technologies
Free Today! Guaranteed Training- Pass 200-530 Exam.

Q46. Which combination of the following filtering techniques prevents cross-site scripting (XSS) vulnerabilities? 

A. Strip all occurrences of the string $lt; script. 

B. Strip all occurrences of the string javascript. 

C. Enable magic_quotes_gpc . 

D. None of the above. 

Answer: D


Q47. 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 

Answer: B


Q48. You are creating an application that generates invoices in a variety of formats, including PDF, ODS and HTML. Each of these formats is represented as a PHP class in your application. While some of the operations can be performed on all of the different formats (such as saving and loading), other operations may be specific to one or two of the formats (such as setting as read only). Which design pattern should you use for this application? 

A. Adapter 

B. Factory 

C. MVC 

D. Singleton 

Answer: B


Q49. What is the output of the following script? 

1 <?php 

2 function fibonacci ($x1, $x2) 

3 { 

4 return $x1 + $x2; 

5 } 

7 $x1 = 0; 

8 $x2 = 1; 

10 for ($i = 0; $i < 10; $i++) { 

11 echo fibonacci($x1, $x2) . ',' 

12 } 

13 ?> 

A. 1,2,3,4,5,6,7,8,9 

B. 1,2,3,4,5,6,7,8,9,10, 

C. 1,2,3,5,8,13,21,34,55,89, 

D. 1,1,1,1,1,1,1,1,1,1, 

Answer: D


Q50. What will the following code print? 

echo addslashes('I am a <b>small</b> "HTML" string, which is 

\'invalid\'</u>.'); 

A. I am a <b>small</b> "HTML" string, which is 'invalid'</u>. 

B. I am a <b>small</b> \"HTML\" string, which is \'invalid\'</u>. 

C. I am a <b>small</b> \"HTML\" string, which is \\'invalid\\'</u>. 

D. I am a <b>small</b> \"HTML\" string, which is \\\'invalid\\\'</u>. 

E. I am a \<b\>small\<\/b\> "HTML" string, which is 'invalid'\<\/u\>. 

Answer: B


Q51. Which of the following code snippets writes the content of the “source.txt” to “target.txt”? 

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"), "")); 

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); 

Answer: ADE


Q52. What does the chown() function do? 

A. Change the file permissions. 

B. Change the owner of the file. 

C. Change the group of the file. 

D. Checks if the file is accessible. 

Answer: B


Q53. Is the following code piece E_STRICT compliant? 

final class Testing { private $test; 

public function tester() { 

return "Tested!"; 

}} 

A. Yes 

B. No 

Answer: A


Q54. When working with the MVC paradigma, the business logic should be implemented in which of the following components? 

A. Model 

B. View 

C. Controller 

Answer: A


Q55. Given a JSON-encoded string, which code sample correctly indicates how to decode the string to native PHP values? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer: C


Q56. Which of the following functions can help prevent session fixation vulnerabilities? 

A. magic_quotes_gpc() 

B. strip_tags() 

C. addslashes() 

D. session_regenerate_id() 

Answer: D


Q57. What is the purpose of the open_basedir directive? 

A. Provide a list of directories where PHP should search for files. 

B. Provide a list of directories from which PHP can open files. 

C. Provide a list of directories from which PHP cannot open files. 

D. Directory where the PHP extensions can be found. 

Answer: B


Q58. Which of the following rules must every correct XML document adhere to? (Choose 2) 

A. It has to be well-formed. 

B. It has to be valid. 

C. It has to be associated to a DTD. 

D. It may only contain UTF-8 encoded characters. 

Answer: AB


Q59. How many elements does the $matches array contain after the following function call is performed? 

preg_match('/^(\d{1,2}([a-z]+))(?:\s*)\S+ (?=200[0-9])/', '21st March 

2006', $matches); 

A. 1 

B. 2 

C. 3 

D. 4 

Answer: C


Q60. You have a variable $test that contains sub-strings divided by a dash ("-"). How can you put every sub-string into an array element easily? 

A. extract($test, "-"); 

B. explode("-", $test); 

C. to_array($test, "-"); 

D. explode($test, "-"); 

Answer: B