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

200-550 Zend Certified PHP Engineer Questions and Answers

Questions 4

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

Buy Now
Questions 5

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

Buy Now
Questions 6

What is the recommended 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);

Buy Now
Questions 7

Which line of code can be used to replace the INSERT comment in order to output "hello"?

class C {

public $ello = 'ello';

public $c;

public $m;

function __construct($y) {

$this->c = static function($f) {

// INSERT LINE OF CODE HERE

};

$this->m = function() {

return "h";

};

}

}

$x = new C("h");

$f = $x->c;

echo $f($x->m);

Options:

A.

return $this->m() . "ello";

B.

return $f() . "ello";

C.

return "h". $this->ello;

D.

return $y . "ello";

Buy Now
Questions 8

What types of HTTP authentication are supported by PHP? (Choose 2)

Options:

A.

Basic

B.

Advanced

C.

Strict

D.

Digest

E.

Realm

Buy Now
Questions 9

How can you determine whether a PHP script has already sent cookies to the client?

Options:

A.

Use $_COOKIE

B.

Use the getcookie() function

C.

Use the headers_sent() function

D.

Use JavaScript to send a second HTTP request

Buy Now
Questions 10

Your application uses PHP to accept and process file uploads. It fails to upload a file that is 5 MB in size, although upload_max_filesize is set to "10M". Which of the following configurations could be responsible for this outcome? (Choose 2)

Options:

A.

The PHP configuration option post_max_size is set to a value that is too small

B.

The web server is using an incorrect encoding as part of the HTTP response sent to the client

C.

The browser uses an incorrect encoding as part of the HTTP request sent to the server

D.

The hidden form field MAX_FILE_SIZE was set to a value that is too small

E.

PHP cannot process file uploads larger than 4 MB

Buy Now
Questions 11

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

Buy Now
Questions 12

How many elements does the array $pieces contain after the following piece of code has been executed?

$pieces = explode("/", "///");

Options:

A.

0

B.

3

C.

4

D.

5

Buy Now
Questions 13

Which MIME type is always sent by a client if a JPEG file is uploaded via HTTP?

Options:

A.

image/jpeg

B.

image/jpg

C.

image/pjpeg

D.

Depends on the client system

Buy Now
Questions 14

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 15

An HTML form has two submit buttons. After submitting the form, how can you determine with PHP which button was clicked?

Options:

A.

An HTML form may only have one button.

B.

You cannot determine this with PHP only. You must use JavaScript to add a value to the URL depending on which button has been clicked.

C.

Put the two buttons in different forms, but make sure they have the same name.

D.

Assign name and value attributes to each button and use $_GET or $_POST to find out which button has been clicked.

Buy Now
Questions 16

What super-global should be used to access information about uploaded files via a POST request?

Options:

A.

$_SERVER

B.

$_ENV

C.

$_POST

D.

$_FILES

E.

$_GET

Buy Now
Questions 17

Consider the following table data and PHP code, and assume that the database supports transactions. What is the outcome?

Table data (table name "users" with primary key "id"):

id name email

------- ----------- -------------------

1 anna alpha@example.com

2 betty beta@example.org

3 clara gamma@example.net

5 sue sigma@example.info

PHP code (assume the PDO connection is correctly established):

$dsn = 'mysql:host=localhost;dbname=exam';

$user = 'username';

$pass = '********';

$pdo = new PDO($dsn, $user, $pass);

try {

$pdo->exec("INSERT INTO users (id, name, email) VALUES (6, 'bill', 'delta@example.com')");

$pdo->begin();

$pdo->exec("INSERT INTO users (id, name, email) VALUES (7, 'john', 'epsilon@example.com')");

throw new Exception();

} catch (Exception $e) {

$pdo->rollBack();

}

Options:

A.

The user 'bill' will be inserted, but the user 'john' will not be.

B.

Both user 'bill' and user 'john' will be inserted.

C.

Neither user 'bill' nor user 'john' will be inserted.

D.

The user 'bill' will not be inserted, but the user 'john' will be.

Buy Now
Questions 18

What is the output of the following code?

var_dump(boolval([]));

Options:

A.

bool(true)

B.

bool(false)

Buy Now
Questions 19

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.

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

B.

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

C.

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

D.

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

Buy Now
Questions 20

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

Buy Now
Questions 21

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 22

What is the output of the following code?

try {

class MyException extends Exception {};

try {

throw new MyException;

}

catch (Exception $e) {

echo "1:";

throw $e;

}

catch (MyException $e) {

echo "2:";

throw $e;

}

}

catch (Exception $e) {

echo get_class($e);

}

Options:

A.

A parser error, try cannot be followed by multiple catch

B.

1:

C.

2:

D.

1:Exception

E.

1:MyException

F.

2:MyException

G.

MyException

Buy Now
Questions 23

Which of the following are valid identifiers? (Choose 3)

Options:

A.

function 4You() { }

B.

function _4You() { }

C.

function object() { }

D.

$1 = "Hello";

E.

$_1 = "Hello World";

Buy Now
Questions 24

What is the output of the following code?

class Test {

public function __call($name, $args)

{

call_user_func_array(array('static', "test$name"), $args);

}

public function testS($l) {

echo "$l,";

}

}

class Test2 extends Test {

public function testS($l) {

echo "$l,$l,";

}

}

$test = new Test2();

$test->S('A');

Options:

A.

A,

B.

A,A,

C.

A,A,A,

D.

PHP Warning: call_user_func_array() expects parameter 1 to be a valid callback

Buy Now
Questions 25

What is the output of the following code?

$text = 'This is text';

$text1 = <<<'TEXT'

$text

TEXT;

$text2 = <<

$text1

TEXT;

echo "$text2";

Options:

A.

This is text

B.

$text

C.

$text1

D.

$text2

Buy Now
Questions 26

Under what condition may HTTP headers be set from PHP if there is content echoed prior to the header function being used?

Options:

A.

headers_sent() returns true

B.

Output buffering is enabled

C.

The client supports local buffering

D.

The webserver uses preemptive mode

Buy Now
Questions 27

Which of the following is an invalid DOM save method?

Options:

A.

save()

B.

saveFile()

C.

saveXML()

D.

saveHTML()

E.

saveHTMLFile()

Buy Now
Questions 28

Consider the following code:

$result = $value1 ??? $value2;

Which operator needs to be used instead of ??? so that $result equals $value1 if $value1 evaluates to true, and equals $value2 otherwise? Just state the operator as it would be required in the code.

Options:

Buy Now
Questions 29

Which of the following techniques ensures that a value submitted in a form can only be yes or no ?

Options:

A.

Use a select list that only lets the user choose between yes and no .

B.

Use a hidden input field that has a value of yes or no .

C.

Enable the safe_mode configuration directive.

D.

None of the above.

Buy Now
Questions 30

Which PHP function sets a cookie and URL encodes its value when sending it to the browser?

Options:

Buy Now
Questions 31

How should you track errors on your production website?

Options:

A.

Enabling display_errors

B.

Enabling log_errors

C.

Having a site-wide exception handler

D.

Setting error_reporting to E_ALL & ~E_NOTICE

Buy Now
Questions 32

What is "instanceof" an example of?

Options:

A.

a boolean

B.

an operator

C.

a function

D.

a language construct

E.

a class magic

Buy Now
Questions 33

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

E.

getresponseheaders()

Buy Now
Exam Code: 200-550
Exam Name: Zend Certified PHP Engineer
Last Update: Nov 21, 2024
Questions: 223
200-550 pdf

200-550 PDF

$28  $80
200-550 Engine

200-550 Testing Engine

$33.25  $95
200-550 PDF + Engine

200-550 PDF + Testing Engine

$45.5  $130