Labour Day - Special 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: 70dumps

200-550 Questions and Answers

Question # 6

From your PHP application, how can you send the same header twice, but with different values?

A.

Set the second argument of the header() function to false

B.

PHP does that automatically

C.

You may only send a particular type of header once

D.

Use the header_add() function

Full Access
Question # 7

What is "instanceof" an example of?

A.

a boolean

B.

an operator

C.

a function

D.

a language construct

E.

a class magic

Full Access
Question # 8

What is the output of the following code?

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

$a[$i] = $i;

}

echo count($a);

A.

0

B.

1

C.

2

D.

6

E.

7

Full Access
Question # 9

What is the name of the method that can be used to provide read access to virtual properties in a class?

A.

__call()

B.

__get()

C.

__set()

D.

__wakeup()

E.

__fetch()

Full Access
Question # 10

What is the output of the following code?

class Number {

private $v;

private static $sv = 10;

public function __construct($v) { $this->v = $v; }

public function mul() {

return static function ($x) {

return isset($this) ? $this->v*$x : self::$sv*$x;

};

}

}

$one = new Number(1);

$two = new Number(2);

$double = $two->mul();

$x = Closure::bind($double, null, 'Number');

echo $x(5);

A.

5

B.

10

C.

50

D.

Fatal error

Full Access
Question # 11

Late static binding is used in PHP to:

A.

Load dynamic libraries and extensions at runtime

B.

Use caller class information provided in static method call

C.

Resolve undefined class names by automatically including needed files

D.

Find proper method to call according to the call arguments

Full Access
Question # 12

Which PHP function is used to validate whether the contents of $_FILES['name']['tmp_name'] have really been uploaded via HTTP?

Full Access
Question # 13

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

A.

""

B.

"/wireless"

C.

"wireless"

D.

"/conf.d/wireless"

E.

"/etc"

Full Access
Question # 14

An HTML form contains this form element:

<input type="file" name="myFile" />

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

Full Access
Question # 15

What function can reverse the order of values in an array so that keys are preserved?

A.

array_flip()

B.

array_reverse()

C.

rsort()

D.

krsort()

E.

array_multisort()

Full Access
Question # 16

What is the output of the following code?

echo "22" + "0.2", 23 . 1;

A.

220.2231

B.

22.2231

C.

22.2,231

D.

56.2

Full Access
Question # 17

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?

A.

header()

B.

headers()

C.

headers_list()

D.

headers_sent()

E.

getresponseheaders()

Full Access
Question # 18

What DOM method is used to load HTML files?

A.

load()

B.

loadXML()

C.

loadHTML()

D.

loadHTMLFile()

Full Access
Question # 19

What will be the output value of the following code?

$array = array(1,2,3);

while (list(,$v) = each($array));

var_dump(current($array));

A.

bool(false)

B.

int(3)

C.

int(1)

D.

NULL

E.

Array

Full Access
Question # 20

When a class is defined as final it:

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.

Full Access
Question # 21

What is the pattern modifier for handling UTF-8 encoded preg_* functionality?

A.

e

B.

u

C.

PHP does not support UTF-8 encoded strings

D.

A pattern modifier is not needed

Full Access
Question # 22

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

Full Access
Question # 23

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

Full Access
Question # 24

How do you allow the caller to submit a variable number of arguments to a function?

A.

Using a prototype like function test(... $parameters).

B.

Using a prototype like function test() and the function func_get_args() inside the function body.

C.

Using a prototype like function test($parameters[]).

D.

Using a prototype like function test() and the function get_variable_args() inside the function body.

E.

This is not possible in PHP.

Full Access
Question # 25

Which of the following functions are used to escape data within the context of HTML? (Choose 2)

A.

htmlentities()

B.

addslashes()

C.

stripslashes()

D.

strip_tags()

E.

htmlspecialchars()

Full Access
Question # 26

Which of these statements about PDO is NOT true?

A.

PDO has built-in support for Large Objects (LOBs).

B.

Placeholders within PDO prepared statements need to be named.

C.

When something goes wrong, PDO can throw an instance of its own exception class.

D.

PDO does not emulate missing database features.

Full Access
Question # 27

Which constant must be passed as the second argument to htmlentities() to convert single quotes (') to HTML entities?

A.

TRUE

B.

FALSE

C.

ENT_QUOTES

D.

ENT_NOQUOTES

E.

ENT_COMPAT

Full Access
Question # 28

How many times will the function counter() be executed in the following code?

function counter($start, &$stop)

{

if ($stop > $start)

{

return;

}

counter($start--, ++$stop);

}

$start = 5;

$stop = 2;

counter($start, $stop);

A.

3

B.

4

C.

5

D.

6

Full Access
Question # 29

Which of the following is an invalid DOM save method?

A.

save()

B.

saveFile()

C.

saveXML()

D.

saveHTML()

E.

saveHTMLFile()

Full Access
Question # 30

What is the output of the following code?

var_dump(boolval(-1));

A.

bool(true)

B.

bool(false)

Full Access
Question # 31

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

A.

SplFixedArray

B.

SplObjectStorage

C.

SplString

D.

spl_object_hash

E.

spl_same_object

Full Access
Question # 32

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;

}

A.

one

B.

two

C.

three

D.

four

Full Access
Question # 33

Which of the following statements about PHP is false? (Choose 2)

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.

Full Access