Weekend Sale Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: netbudy65

200-500 Zend PHP 5 Certification Questions and Answers

Questions 4

When you need to process the values of columns in a database, you should:

Options:

A.

Only use built-in database functions

B.

Always use read the values as-is from the database and then process them with PHP

C.

Use built-in database functions for simple processing, and perform more complicated logic in PHP

D.

Use built-in database functions for complicated logic, and perform simpler functions in PHP

Buy Now
Questions 5

Webservices are primarily meant to support

Options:

A.

business-to-business communication

B.

machine-to-machine interaction

C.

improved accessibility for websites

Buy Now
Questions 6

Which constant must be passed as the second argument to htmlentities() to convert single quotes (') to HTML entities?

Options:

A.

TRUE

B.

FALSE

C.

ENT_QUOTES

D.

ENT_NOQUOTES

E.

ENT_COMPAT

Buy Now
Questions 7

An HTML form contains this form element:

The user clicks on the image to submit the form. How can you now access the relative coordinates of the mouse click?

Options:

A.

$_IMAGE['myImage']['x'] and $_IMAGE['myImage']['y']

B.

$_POST['myImage']['x'] and $_POST['myImage']['x']

C.

$_POST['myImage.x'] and $_POST['myImage.y']

D.

$_POST['myImage_x'] and $_POST['myImage_y']

Buy Now
Questions 8

What is the output of the following script?

1

2 class a

3 {

4 public $val;

5 }

6

7 function renderVal (a $a)

8 {

9 if ($a) {

10 echo $a->val;

11 }

12 }

13

14 renderVal (null);

15 ?>

Options:

A.

A syntax error in the function declaration line

B.

An error, because null is not an instance of 'a'

C.

Nothing, because a null value is being passed to renderVal()

D.

NULL

Buy Now
Questions 9

Given the following code, what is correct?

function f(stdClass &$x = NULL) { $x = 42;

}

$z = new stdClass;

f($z);

var_dump($z);

Options:

A.

Error: Typehints cannot be NULL

B.

Error: Typehints cannot be references

C.

Result is NULL

D.

Result is object of type stdClass

E.

Result is 42

Buy Now
Questions 10

Which of the listed changes would you make to the following PHP 4 code in order to make it most compliant with PHP 5? (Choose 2)

class Car {

var $model;

function Car($model) {

$this->model = $model;

} function toString() {

return "I drive a $this->model.";

}}

$c = new Car('Dodge');

echo $c->toString();

?>

Options:

A.

Change var to public or private

B.

Change function Car to function_construct

C.

Change "I drive a $this->model." to "I drive a {$this->model}."

D.

Change function toString()to static function toString()

Buy Now
Questions 11

One common security risk is exposing error messages directly in the browser. Which PHP configuration directive can be disabled to prevent this?

Options:

A.

html_display

B.

error_reporting

C.

display_errors

D.

error_log

E.

ignore_repeated_errors

Buy Now
Questions 12

You work for a shared hosting provider, and your supervisor asks you to disable user scripts to dynamically load PHP extensions using the dl() function. How can you do this? (Choose 2)

Options:

A.

Set enable_dl to Off in the server's php.ini configuration file.

B.

Add dl to the current value of disable_functions in the server's php.ini configuration file.

C.

Add dl to the current value of disable_classes in the server's php.ini configuration file.

D.

Write a custom function called dl(), save it under the name prepend.inc and then set the auto_prepend_file directive to prepend.inc in php.ini.

Buy Now
Questions 13

What parsing methodology is utilized by the SimpleXML extension?

Options:

A.

SAX

B.

DOM

C.

XPath

D.

Push/Pull Approach

E.

Expat

Buy Now
Questions 14

What DOM method is used to load HTML files?

Options:

A.

load()

B.

loadXML()

C.

loadHTML()

D.

loadHTMLFile()

Buy Now
Questions 15

$_SERVER consists of data provided by the web server and is therefore trustworthy.

Options:

A.

TRUE

B.

FALSE

Buy Now
Questions 16

What does the __FILE__ constant contain?

Options:

A.

The filename of the current script.

B.

The full path to the current script.

C.

The URL of the request made.

D.

The path to the main script.

Buy Now
Questions 17

How to read a single line, no matter how long from an file opened in the example below?

$fp = fopen("my_file.txt", "w");

Options:

A.

fgets($fp);

B.

fgets($fp, -1);

C.

fread($fp, 1024);

D.

fgetss($fp);

E.

None of the above

Buy Now
Questions 18

What is the output of the following script?

1

2 function ratio ($x1 = 10, $x2)

3 {

4 if (isset ($x2)) {

5 return $x2 / $x1;

6 }

7 }

8

9 echo ratio (0);

10 ?>

Options:

A.

0

B.

An integer overflow error

C.

A warning, because $x1 is not set

D.

A warning, because $x2 is not set

E.

A floating-point overflow error

Buy Now
Questions 19

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

Options:

A.

There is no difference

B.

Print returns length of data printed and echo does not

C.

Echo returns length of the data printed and print does not

D.

Print buffers the output, while echo does not

Buy Now
Questions 20

Which elements does the array returned by the function pathinfo() contain?

Options:

A.

root, dir, file

B.

dirname, filename, fileextension

C.

dirname, basename, extensio

D.

path, file

Buy Now
Questions 21

How can you redirect a client to another page using PHP?

Options:

A.

header('Location: /another_page.php');

B.

header('Content-Location: /another_page.php');

C.

header('Redirect: /another_page.php');

D.

header('Redirect: /another_page.php', 1, 302);

E.

header('HTTP/1.1 302 /another_page.php');

Buy Now
Questions 22

How can precisely one byte be read from a file, pointed by $fp? (Choose 2)

Options:

A.

fread($fp, 1);

B.

fgets($fp, 1);

C.

fgetss($fp, 1);

D.

fgetc($fp);

E.

All of the above

Buy Now
Questions 23

What PHP function can be used to remove a local file?

Options:

A.

A) rmdir()

B.

B) unlink()

C.

C) rm()

D.

D) delete()

E.

E) delete_file()

Buy Now
Questions 24

What is the output of the following script?

1

2 function fibonacci (&$x1 = 0, &$x2 = 1)

3 {

4 $result = $x1 + $x2;

5 $x1 = $x2;

6 $x2 = $result;

7

8 return $result;

9 }

10

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

12 echo fibonacci() . ',';

13 }

14 ?>

Options:

A.

An error

B.

1,1,1,1,1,1,1,1,1,1,

C.

1,1,2,3,5,8,13,21,34,55,

D.

Nothing

Buy Now
Questions 25

After executing a SELECT query on a database server,

Options:

A.

All data is immediately transmitted to PHP

B.

All data will be transmitted on-demand to PHP

C.

None of the above

Buy Now
Questions 26

Identify the security vulnerability in the following example:

1

2 mail('feedback@example.org',

3 'Feddback',

4 'Here is my feedback.',

5 "From: {$_COOKIE['email']}");

6 ?>

Options:

A.

Remote Code Injection

B.

Cross-Site Request Forgeries

C.

Email Injection

D.

None of the above

Buy Now
Questions 27

What is the output of the following code:

str_replace(array("Apple","Orange"), array("Orange","Apple"), "Oranges are orange and Apples are green");

Options:

A.

Apples are orange and Oranges are green

B.

Apples are orange and Apples are green

C.

Apples are apple and Oranges are green

D.

Apples are apple and Apples are green

Buy Now
Questions 28

What is the method used to execute XPath queries in the SimpleXML extension?

Options:

A.

xpathQuery()

B.

xpath()

C.

simpleXMLXpath()

D.

query()

E.

evaluate()

Buy Now
Questions 29

What happens if you try to access a property whose name is defined in a parent class as private, and is not declared in the current class?

Options:

A.

An E_NOTICE error will be triggered.

B.

An E_ERROR error will be triggered.

C.

An E_WARNING error will be triggered.

D.

No errors will be triggered

Buy Now
Questions 30

Which of the following code snippets writes the content of the file "source.txt" to "target.txt"? (Choose 3)

Options:

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

Buy Now
Questions 31

How can XML parsing errors be suppressed in the SimpleXML extension?

Options:

A.

error_reporting(E_ALL^E_NOTICE);

B.

simplexml_disable_errors(TRUE);

C.

simplexml_ignore_errors(TRUE);

D.

libxml_use_internal_errors(TRUE);

E.

simplexml_load_file("file.xml", LIBXML_NOERROR);

Buy Now
Questions 32

Which of the following code snippets is correct? (Choose 2)

a)

interface Drawable {

abstract function draw();

}

b)

interface Point {

function getX();

function getY();

}

c)

interface Line extends Point {

function getX2();

function getY2();

}

d)

interface Circle implements Point {

function getRadius();

}

Options:

A.

a)

B.

b)

C.

c)

D.

d)

Buy Now
Exam Code: 200-500
Exam Name: Zend PHP 5 Certification
Last Update: May 17, 2024
Questions: 219

PDF + Testing Engine

$130

Testing Engine

$95

PDF (Q&A)

$80