Easter Sale Special 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: exams65

Zend PHP 5 Certification Question and Answers

Zend PHP 5 Certification

Last Update May 15, 2024
Total Questions : 219

We are offering FREE 200-500 Zend exam questions. All you do is to just go and sign up. Give your details, prepare 200-500 free exam questions and then go for complete pool of Zend PHP 5 Certification test questions that will help you more.

200-500 pdf

200-500 PDF

$35  $99.99
200-500 Engine

200-500 Testing Engine

$42  $119.99
200-500 PDF + Engine

200-500 PDF + Testing Engine

$56  $159.99
Questions 1

Which technique should be used to speed up joins without changing their results?

Options:

A.  

Add indices on joined columns

B.  

Add a WHERE clause

C.  

Add a LIMIT clause

D.  

Use an inner join

Discussion 0
Questions 2

Which of the following function signatures is correct if you want to have classes automatically loaded?

Options:

A.  

function autoload($class_name)

B.  

function __autoload($class_name, $file)

C.  

function __autoload($class_name)

D.  

function _autoload($class_name)

E.  

function autoload($class_name, $file)

Discussion 0
Questions 3

Given the following two functions, what statement is correct?

function dynamicNew($name) {

return new $name;

}

function reflectionNew($name) {

$r = new ReflectionClass($name);

return $r->newInstanceArgs();

}

Options:

A.  

Both functions do the same

B.  

dynamicNew() results in a parse error, reflectionNew() works

Discussion 0
Questions 4

After running this sort, what will be the value of $b?

$a = array('_!', 'def', 0);

$b = sort($a);

Options:

A.  

array(0, 'def', '_!')

B.  

array('_!', 0, 'def')

C.  

array('def', 0, '_!)

D.  

None of the above

Discussion 0
Questions 5

After executing a query on a database server, PHP offers several functions to read the resulting lines, such as mysqli_fetch_assoc, pg_fetch_row, oci_fetch,etc.). If such functions do not return any rows, it means: (Choose 2)

Options:

A.  

a SELECT statement returned no rows

B.  

the transaction has been rolled back

C.  

the connection to the database server was disconnected during query execution

D.  

the query was too slow to execute

Discussion 0
Questions 6

Some databases support the LIMIT clause. It is a method to ensure that ...

Options:

A.  

only certain rows are deleted in DELETE queries.

B.  

only a defined subset of rows are read in SELECT queries.

C.  

only certain users can access the database.

Discussion 0
Questions 7

Which methods can be used to overload object properties? (Choose 2)

Options:

A.  

set(), get()

B.  

__set(), __get()

C.  

__put(), __receive(), __exists()

D.  

set(), get(), isset()

E.  

__isset(), __unset()

Discussion 0
Questions 8

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']

Discussion 0
Questions 9

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

Discussion 0
Questions 10

What is the result of the following bitwise operation in PHP?

1 ^ 2

Options:

A.  

1

B.  

3

C.  

2

D.  

4

Discussion 0
Questions 11

When a class is defined as final it:

Options:

A.  

Can no longer be extended by other classes.

B.  

Means methods in the class are not over-loadable.

C.  

Cannot be defined as such, final is only applicable to object methods.

D.  

Is no longer iteratable.

Discussion 0
Questions 12

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

Discussion 0
Questions 13

Type hinting in PHP allows the identification of the following variable types: (Choose 2)

Options:

A.  

String

B.  

Integer

C.  

Array

D.  

Any class or interface type

Discussion 0
Questions 14

When checking whether two English words are pronounced alike, which function should be used for the best possible result?

Options:

A.  

levenshtein()

B.  

metaphone()

C.  

similar_text()

D.  

soundex()

Discussion 0
Questions 15

Which of the following statements about SOAP is NOT true?

Options:

A.  

SOAP is a request-/response-based protocol.

B.  

SOAP can be transported using SMTP, HTTP and other protocols.

C.  

SOAP requires developers to use WSDL.

D.  

SOAP traffic via HTTP can be encrypted and compressed just like other HTTP requests.

Discussion 0
Questions 16

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;

}

Options:

A.  

one

B.  

two

C.  

three

D.  

four

Discussion 0
Questions 17

Which 2.17of the following formats is used to describe web services?

Options:

A.  

WSDL

B.  

UDDI

C.  

SOAP

D.  

XLANG

Discussion 0
Questions 18

What will the following code piece print?

echo strtr('Apples and bananas', 'ae', 'ea')

Options:

A.  

Applas end benenes

B.  

Epplas end benenes

C.  

Apples and bananas

D.  

Applas end bananas

Discussion 0
Questions 19

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

Discussion 0
Questions 20

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

Discussion 0
Questions 21

Which of the following XML declarations is NOT valid?

Options:

A.  

B.  

C.  

D.  

Discussion 0
Questions 22

You are creating an application that repeatedly connects to a database to retrieve order data for invoices. All data comes from the same database. In order to preserve resources, you have to ensure that only one database connection should be used at any time. The code also has to open as few new database connections as possible. Which design pattern should you use for this scenario?

Options:

A.  

Adapter

B.  

Factory

C.  

MVC

D.  

Singleton

Discussion 0
Questions 23

What is the output of the following code?

try {

class MyException extends Exception {};

try {

throw new MyException;

}

catch (Exception $e) {

echo "1:";

throw $e;

}c

atch (MyException $e) {

echo "2:";

throw $e;

}}

catch (Exception $e) {

echo get_class($e);

}

Options:

A.  

A parser error, try cannot be followd by multiple catch

B.  

1:

C.  

2:

D.  

1:Exception

E.  

1:MyException

F.  

2:MyException

G.  

MyException

Discussion 0
Questions 24

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

Options:

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.

Discussion 0
Questions 25

What is the output of the following code?

str_pad('PHP', 10, 'P', STR_PAD_BOTH);

Options:

A.  

H

B.  

PHPPPPPPPP

C.  

PPPPHPPPPP

D.  

PPPPPPPPHP

Discussion 0
Questions 26

When comparing prepared statements and regular, application-constructed SQL statements, which of the following is true?

Options:

A.  

Prepared statements are faster

B.  

Prepared statements are always shorter

C.  

Prepared statements are more secure

D.  

Prepared statements are easier to develop

E.  

None of the above

Discussion 0
Questions 27

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

Options:

A.  

addslashes()

B.  

htmlentities()

C.  

htmlspecialchars()

D.  

strip_tags()

E.  

quotemeta()

Discussion 0
Questions 28

When uploading a file to a PHP script using the HTTP PUT method, where would the information about this file be available?

Options:

A.  

the $_FILES super-global

B.  

the input stream php://stdin

C.  

the $_POST super-global

D.  

the global variable scope

Discussion 0
Questions 29

Which PHP function retrieves a list of HTTP headers that have been sent as part of the HTTP response or are ready to be sent?

Options:

A.  

header()

B.  

headers()

C.  

headers_list()

D.  

headers_sent()

Discussion 0
Questions 30

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

Discussion 0
Questions 31

What function allows resizing of PHP's file write buffer?

Options:

A.  

ob_start()

B.  

set_write_buffer()

C.  

stream_set_write_buffer()

D.  

Change the output_buffering INI setting via ini_set() function

Discussion 0
Questions 32

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

Discussion 0