Summer Sale Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: ecus65

Zend 200-550 - Zend Certified PHP Engineer

Page: 6 / 7
Total 223 questions

Before the headers are sent, how can you remove a previously set header?

A.

Use the header_remove() function, providing the name of the header

B.

Use the die() function to abort the PHP script

C.

Not possible

D.

Use the headers_list() function, providing the name of the header as the second argument

What is the output of the following code?

$first = "second";

$second = "first";

echo $$$first;

A.

"first"

B.

"second"

C.

an empty string

D.

an error

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

A.

Authorization-Required

B.

WWW-Authenticate

C.

HTTP-Authenticate

D.

Authentication-Required

E.

HTTP-Auth

In the following code, which classes can be instantiated?

abstract class Graphics {

abstract function draw($im, $col);

}

abstract class Point1 extends Graphics {

public $x, $y;

function __construct($x, $y) {

$this->x = $x;

$this->y = $y;

}

function draw($im, $col) {

ImageSetPixel($im, $this->x, $this->y, $col);

}

}

class Point2 extends Point1 { }

abstract class Point3 extends Point2 { }

A.

Graphics

B.

Point1

C.

Point2

D.

Point3

E.

None, the code is invalid

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

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

An HTML form contains this form element:

When this form is submitted, the following PHP code gets executed:

move_uploaded_file(

$_FILES['myFile']['tmp_name'],

'uploads/' . $_FILES['myFile']['name']

);

Which of the following actions must be taken before this code may go into production? (Choose 2)

A.

Check with is_uploaded_file() whether the uploaded file $_FILES['myFile']['tmp_name'] is valid

B.

Sanitize the file name in $_FILES['myFile']['name'] because this value is not consistent among web browsers

C.

Check the charset encoding of the HTTP request to see whether it matches the encoding of the uploaded file

D.

Sanitize the file name in $_FILES['myFile']['name'] because this value could be forged

E.

Use $HTTP_POST_FILES instead of $_FILES to maintain upwards compatibility

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

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

A.

array_rand($array);

B.

array_rand($array, 1);

C.

shuffle($array);

D.

$array[array_rand($array)];

E.

array_values($array, ARRAY_RANDOM);

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

A.

A single function

B.

A single method from a class

C.

All methods from a class

D.

All classes defined in a script

Which of the following statements about Reflection is correct?

A.

Reflection is an extension that can be disabled

B.

Reflection is a new extension present only in PHP 5.3+

C.

Reflection only allows to reflect on built-in classes

D.

Built-in classes can be reflected on command line using php --rc

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)

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