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

Zend 200-500 Dumps

Page: 1 / 8
Total 219 questions

Zend PHP 5 Certification Questions and Answers

Question 1

What is the maximum size of the VARCHAR column type?

Options:

A.

255 Bytes

B.

255 Characters

C.

512 Bytes

D.

512 Characters

E.

No Limit

Question 2

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

Question 3

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

Question 4

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.

Question 5

You want to run the following PHP 4 code with PHP 5. In the following example, which access modifier in PHP 5 is equivalent to "var"?

class Test {

var $tester;

}

Options:

A.

protected

B.

invisible

C.

public

D.

private

E.

outofscope

Question 6

What is the output of the following code?

echo 0x33, ' monkeys sit on ', 011, ' trees.';

Options:

A.

33 monkeys sit on 11 trees.

B.

51 monkeys sit on 9 trees.

C.

monkeys sit on trees.

D.

0x33 monkeys sit on 011 trees.

Question 7

Which of the following statements about PHP is true? (Choose 3)

a) A final class can be derived.

b) A final class may be instantiated.

c) A class with a final function may be derived.

d) Static functions can be final.

e) Properties can be final.

Options:

A.

a)

B.

b)

C.

c)

D.

d)

E.

e)

Question 8

Which of the following statements is correct?

Options:

A.

Interfaces can extend only one interface

B.

Interfaces can extend more than one interface

C.

Interfaces can inherit a method from different interfaces

D.

Interfaces can redeclare inherited methods

Question 9

How can you determine if magic_quotes_gpc is enabled? (Choose 2)

Options:

A.

Use the get_magic_quotes() function.

B.

Using the get_magic_quotes_runtime() function.

C.

Use the get_magic_quotes_gpc() function.

D.

Using ini_get('magic_quotes_gpc').

E.

Using ini_get('magic_quotes').

Question 10

What is the output of the following code?

1

2 for ($i = 0; $i < 1.02; $i += 0.17) {

3 $a[$i] = $i;

4 }

5 echo count($a);

6 ?>

Options:

A.

0

B.

1

C.

2

D.

6

E.

7

Question 11

Which of the following did not result in an output error in PHP 4 but does in PHP 5?

Options:

A.

Using 'var' as an access modifier.

B.

Assigning a new object instance to $this in a constructor.

C.

Passing an object by-reference.

D.

Passing an object by-value.

Question 12

Given the default PHP configuration, how can all of the parameters provided via GET be accessed in a form of a string?

Options:

A.

$_GET['ALL']

B.

$_SERVER['QUERY']

C.

$_SERVER['QUERY_STRING']

D.

$_ENV['QUERY']

E.

$QUERY_STRING

Question 13

You want to present the following formatted number: "999.000.000,00". Which function call is correct?

Options:

A.

print format_number(999000000);

B.

print number_format(999000000);

C.

print number_format(999000000, 2, ',', '.');

D.

print number_format(999000000, 2);

E.

print_number(999000000, 2, ',', '.')

Question 14

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

Question 15

After performing the following operations:

$a = array('a', 'b', 'c');

$a = array_keys(array_flip($a));

What will be the value of $a?

Options:

A.

array('c', 'b', 'a')

B.

array(2, 1, 0)

C.

array('a', 'b', 'c')

D.

None of the above

Question 16

When PHP is running on a command line, what super-global will contain the command line arguments specified?

Options:

A.

$_SERVER

B.

$_ENV

C.

$GLOBALS

D.

$_POST

E.

$_ARGV

Question 17

You analyze the code of a colleague and see a call to the function quotemeta(). You give the string "Holy $%&[. What's going on?" as a parameter to it. What will it output?

Options:

A.

Holy $%&[. What's going on?

B.

Holy \$%&\[\. What's going on\?

C.

Holy $%&[. What\'s going on?

D.

Holy \$\%\&\[\. What\'s going on\?

Question 18

What method can be used to find a tag with the name "foo" via the DOM extension?

Options:

A.

getElementById()

B.

getElementsByTagName()

C.

getElementsByTagNameNS()

D.

getElementByName()

E.

findTag()

Question 19

What will the following code print?

echo addslashes('I am a small "HTML" string, which is

\'invalid\'.');

Options:

A.

I am a small "HTML" string, which is 'invalid'.

B.

I am a small \"HTML\" string, which is \'invalid\'.

C.

I am a small \"HTML\" string, which is \\'invalid\\'.

D.

I am a small \"HTML\" string, which is \\\'invalid\\\'.

E.

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

Question 20

Assume that you are using PHP s session management without cookies and want to make sure that session information does not get lost when redirecting the client to another URL. Which of the following functions do you need to achieve that? (Choose 3)

Options:

A.

header()

B.

session_id()

C.

session_info()

D.

session_name()

E.

session_write_close()

Question 21

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

Question 22

What is the purpose of the open_basedir directive?

Options:

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.

Question 23

How can the line on which HTTP headers were sent inside a script be determined?

Options:

A.

Using the headers_sent() function.

B.

Using the output_start() function.

C.

Using the ob_start() function.

D.

Cannot be determined

Question 24

The following form is loaded in a recent browser and submitted, with the second list element selected:

In the server-side PHP code to deal with the form data, what is the value of $_POST['list']?

Options:

A.

1

B.

2

C.

two

D.

null (since the value attribute of the list has not been set)

Question 25

Which function can help prevent cross-site scripting? (Choose 2)

Options:

A.

addslashes()

B.

htmlentities()

C.

htmlspecialchars()

D.

strip_tags()

E.

quotemeta()

Question 26

What can prevent PHP from being able to open a file on the hard drive (Choose 3)?

Options:

A.

File system permissions

B.

File is outside of open_basedir

C.

File is owned by another user and safe_mode is enabled.

D.

File is inside the /tmp directory.

E.

PHP is running as the web server user.

Question 27

What function can reverse the order of values in an array without the loss of key information?

Options:

A.

array_flip()

B.

array_reverse()

C.

rsort()

D.

krsort()

E.

array_multisort()

Question 28

When a transaction reports no affected rows, it means that: (Choose 2)

Options:

A.

The transaction failed

B.

The transaction affected no lines

C.

The transaction was rolled back

D.

The transaction was committed without error

Question 29

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

Options:

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

Question 30

What XML component does the following XPath query try to match?

//foo[bar/@id=5]

Options:

A.

bar element with an id attribute whose value is equal to 5

B.

foo element containing a child node bar tag

C.

id attribute whose value is equal to 5

D.

foo element with a child note bar whose id attribute is equal to 5

E.

all of the foo elements that have a child node bar, whose id attribute is equal to 5

Question 31

What does the chown() function do?

Options:

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.

Question 32

An object can be counted with count() and sizeof() if it

Options:

A.

implements ArrayAccess

B.

has a public __count() method

C.

was cast to an object from an array

D.

None of the above

Page: 1 / 8
Total 219 questions