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

Free and Premium Zend 200-550 Dumps Questions Answers

Page: 1 / 8
Total 223 questions

Zend Certified PHP Engineer Questions and Answers

Question 1

What method can be used to find the tag via the DOM extension?

Options:

A.

getElementById()

B.

getElementsByTagName()

C.

getElementsByTagNameNS()

D.

getElementByName()

E.

findTag()

Buy Now
Question 2

Which string will be returned by the following function call?

$test = '/etc/conf.d/wireless';

substr($test, strrpos($test, '/')); // note that strrpos() is being called, and not strpos()

Options:

A.

""

B.

"/wireless"

C.

"wireless"

D.

"/conf.d/wireless"

E.

"/etc"

Question 3

Which of the following expressions will evaluate to a random value from an array below?

$array = array("Sue","Mary","John","Anna");

Options:

A.

array_rand($array);

B.

array_rand($array, 1);

C.

shuffle($array);

D.

$array[array_rand($array)];

E.

array_values($array, ARRAY_RANDOM);

Question 4

How can a SimpleXML object be converted to a DOM object?

Options:

A.

dom_import_simplexml()

B.

dom_export_simplexml()

C.

simplexml_import_dom()

D.

SimpleXML2Dom()

E.

None of the above.

Question 5

Which of the following are NOT acceptable ways to create a secure password hash in PHP? (Choose 2)

Options:

A.

md5()

B.

hash_pbkdf2()

C.

password_hash()

D.

crypt()

E.

openssl_digest()

Question 6

Which of the following can be registered as entry points with a SoapServer instance (choose 2):

Options:

A.

A single function

B.

A single method from a class

C.

All methods from a class

D.

All classes defined in a script

Question 7

Which of the following is an invalid DOM save method?

Options:

A.

save()

B.

saveFile()

C.

saveXML()

D.

saveHTML()

E.

saveHTMLFile()

Question 8

Which of the following is correct? (Choose 2)

Options:

A.

A class can extend more than one class.

B.

A class can implement more than one class.

C.

A class can extend more than one interface.

D.

A class can implement more than one interface.

E.

An interface can extend more than one interface.

F.

An interface can implement more than one interface.

Question 9

What is the output of the following code?

function z($x) {

return function ($y) use ($x) {

return str_repeat($y, $x);

};

}

$a = z(2);

$b = z(3);

echo $a(3) . $b(2);

Options:

A.

22333

B.

33222

C.

33322

D.

222333

Question 10

Which of the following PHP functions can be used to set the HTTP response code? (Choose 2)

Options:

A.

header_add()

B.

header()

C.

http_set_status()

D.

http_response_code()

E.

http_header_set()

Question 11

What will be the result of the following operation?

$a = array_merge([1,2,3] + [4=>1,5,6]);

echo $a[2];

Options:

A.

4

B.

3

C.

2

D.

false

E.

Parse error

Question 12

What is the output of the following code?

var_dump(boolval([]));

Options:

A.

bool(true)

B.

bool(false)

Question 13

In a shared hosting environment, session data can be read by PHP scripts written by any user. How can you prevent this? (Choose 2)

Options:

A.

Store session data in a different location with session.save_path .

B.

Store session data in a database.

C.

Enable safe_mode .

D.

Set session.name to something unique.

Question 14

What function can be used to retrieve an array of current options for a stream context?

Options:

A.

stream_context_get_params

B.

stream_context_get_default

C.

stream_context_get_options

D.

The 'options' element of the stream_get_meta_data return value

Question 15

Which of the following PHP values may NOT be encoded to a JavaScript literal using PHP's ext/json capabilities?

Options:

A.

'Hello, world!'

B.

function(){ alert("Hello, world!"); }

C.

array('Hello, world!')

D.

array('message' => 'Hello, world!')

Question 16

What DOMElement method should be used to check for availability of a non-namespaced attribute?

Options:

A.

getAttributeNS()

B.

getAttribute()

C.

hasAttribute()

D.

hasAttributeNS()

Question 17

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

Options:

A.

root, dir, file

B.

dirname, filename, fileextension

C.

dirname, basename, extension

D.

path, file

Question 18

What is the name of the key in $_FILES['name'] that contains the number of bytes of the uploaded file?

Options:

Question 19

Which of the following statements about exceptions is correct? (Choose 2)

Options:

A.

you can only throw classes derived from Exception

B.

a try block can have multiple catch blocks

C.

a try block must not be followed by a catch block

D.

try blocks cannot contain nested try blocks

Question 20

Which SPL class implements fixed-size storage?

Options:

Question 21

Which of the following methods are available to limit the amount of resources available to PHP through php.ini? (Choose 2)

Options:

A.

Limit the amount of memory a script can consume

B.

Limit the total amount of memory PHP uses on the entire server

C.

Limit the maximum execution time of a script

D.

Limit the maximum number of concurrent PHP processes

E.

Limit the maximum number of concurrent PHP threads

Question 22

In order to create an object storage where each object would be stored only once, you may use which of the following? (Choose 2)

Options:

A.

SplFixedArray

B.

SplObjectStorage

C.

SplString

D.

spl_object_hash

E.

spl_same_object

Question 23

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

Options:

A.

2, 3, 4

B.

2, 3, 6

C.

4, 5, 6

D.

1, 2, 3

Question 24

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

Options:

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

Question 25

What is the name of the header used to require HTTP authentication?

Options:

A.

Authorization-Required

B.

WWW-Authenticate

C.

HTTP-Authenticate

D.

Authentication-Required

E.

HTTP-Auth

Question 26

What is the preferred method for preventing SQL injection?

Options:

A.

Always using prepared statements for all SQL queries.

B.

Always using the available database-specific escaping functionality on all variables prior to building the SQL query.

C.

Using addslashes() to escape variables to be used in a query.

D.

Using htmlspecialchars() and the available database-specific escaping functionality to escape variables to be used in a query.

Question 27

Which of the following is NOT possible using reflection?

Options:

A.

Analysing of nearly any aspect of classes and interfaces

B.

Analysing of nearly any aspect of functions

C.

Adding class methods

D.

Implement dynamic construction (new with variable class name)

Question 28

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

E.

All of the above

Question 29

What is cached by an opcode cache?

Options:

A.

Compiled PHP code

B.

Native PHP extensions

C.

Data sent to the client

D.

Data received from the database

Question 30

Consider the following code. What can be said about the call to file_get_contents?

$getdata = "foo=bar";

$opts = array('http' =>

array(

'method' => 'POST',

'header' => 'Content-type: application/x-www-form-urlencoded',

'content' => $getdata

)

);

$context = stream_context_create($opts);

$result = false, $context);

Options:

A.

A GET request will be performed on http://example.com/submit.php

B.

A POST request will be performed on http://example.com/submit.php

C.

An error will be displayed

Question 31

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.

Cannot be instantiated.

Question 32

Which value will be assigned to the key 0 in this example?

$foo = array(true, '0' => false, false => true);

Options:

Question 33

PHP's array functions such as array_values() can be used on an object if the object...

Options:

A.

implements Traversable

B.

is an instance of ArrayObject

C.

implements ArrayAccess

D.

None of the above

Page: 1 / 8
Total 223 questions