Labour Day Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: scxmas70

200-500 Exam Dumps - Zend PHP 5 Certification

Question # 4

Which of the following statements about PHP is true? (Choose 3)

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.

A.

a)

B.

b)

C.

c)

D.

d)

E.

e)

Full Access
Question # 5

What function returns the filename component of the file's path:

A.

dirname()

realpath()

B.

basename()

C.

pathinfo()

D.

parse_url()

Full Access
Question # 6

What will the $array array contain at the end of this script?

1

2 function modifyArray (&$array)

3 {

4 foreach ($array as &$value)

5 {

6 $value = $value + 1;

7 }

8

9 $value = $value + 2;

10 }

11

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

13 modifyArray($array);

14 ?>

A.

2, 3, 4

B.

2, 3, 6

C.

4, 5, 6

D.

1, 2, 3

Full Access
Question # 7

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

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.

Full Access
Question # 8

Is the following code piece E_STRICT compliant?

final class Testing {

var $test = 0;

public function tester() {

return "Tested!";

}}

A.

Yes

B.

No

Full Access
Question # 9

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

Full Access
Question # 10

Which piece of code will return the ASCII value of a character?

A.

(int)'t';

B.

ord('t');

C.

to_ascii('t');

D.

chr('t');

Full Access
Question # 11

An HTML form contains this form element:

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

1

2 move_uploaded_file(

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

4 'uploads/' . $_FILES['myFile']['name']);

5 ?>

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 # 12

What is the output of the following script?

1

2 function fibonacci ($x1, $x2)

3 {

4 return $x1 + $x2;

5 }

6

7 $x1 = 0;

8 $x2 = 1;

9

10 for ($i = 0; $i < 10; $i++) {

11 echo fibonacci($x1, $x2) . ',';

12 }

13 ?>

A.

1,2,3,4,5,6,7,8,9

B.

1,2,3,4,5,6,7,8,9,10,

C.

1,2,3,5,8,13,21,34,55,89,

D.

1,1,1,1,1,1,1,1,1,1,

Full Access
Question # 13

What will be the result of the following operation?

array_combine(array("A","B","C"), array(1,2,3));

A.

array("A","B",C",1,2,3)

B.

array(1,2,3,"A","B",C")

C.

array("A"=>1,"B"=>2,"C"=>3)

D.

array(1=>"A",2=>"B",3=>"C")

E.

array(1,2,3)

Full Access
Question # 14

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.

Is no longer iteratable.

Full Access
Question # 15

An object can be counted with count() and sizeof() if it

A.

implements ArrayAccess

B.

has a public __count() method

C.

was cast to an object from an array

D.

None of the above

Full Access
Question # 16

What will the following function call print?

printf('%010.6f', 22);

A.

22

B.

22.00

C.

022.000000

D.

22.000000

Full Access
Question # 17

Which of the following statements about Reflection are correct? (Choose 2)

A.

Since 5.1 reflection is an extension that can be disabled

B.

Reflection is present in any installation of PHP 5 or later

C.

Reflection only allows to reflect on built-in classes

D.

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

Full Access
Question # 18

Given the default PHP configuration, how can all of the parameters provided via GET be accessed in a form of a string?

A.

$_GET['ALL']

B.

$_SERVER['QUERY']

C.

$_SERVER['QUERY_STRING']

D.

$_ENV['QUERY']

E.

$QUERY_STRING

Full Access
Question # 19

Which is the most secure approach for handling dynamic data in SQL queries?

A.

Use addslashes().

B.

Enable magic_quotes_gpc.

C.

Use prepared statements if supported by the database library, data-specific escaping functions otherwise.

D.

Use stored procedures.

Full Access
Question # 20

You want to run the following PHP 4 code with PHP 5. In the following example, which access modifier in PHP 5 is equivalent to "var"?

class Test {

var $tester;

}

A.

protected

B.

invisible

C.

public

D.

private

E.

outofscope

Full Access
Question # 21

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

A.

$_SERVER

B.

$_ENV

C.

$_POST

D.

$_FILES

E.

$_GET

Full Access
Question # 22

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

A.

getAttributeNS()

B.

getAttribute()

C.

hasAttribute()

D.

hasAttributeNS()

Full Access
Question # 23

What is the maximum size of the VARCHAR column type?

A.

255 Bytes

B.

255 Characters

C.

512 Bytes

D.

512 Characters

E.

No Limit

Full Access
Question # 24

You have a variable $test that contains sub-strings divided by a dash ("-"). How can you put every sub-string into an array element easily?

A.

extract($test, "-");

B.

explode("-", $test);

C.

to_array($test, "-");

D.

explode($test, "-");

Full Access
Question # 25

What is the length of a string returned by: md5(rand(), TRUE);

A.

Depends on the value returned by rand() function

B.

32

C.

24

D.

16

E.

64

Full Access
Question # 26

You need to escape special characters to use user input inside a regular expression. Which functions would you use? (Choose 2)

A.

addslashes()

B.

htmlentities()

C.

preg_quote()

D.

regex_quote()

E.

quotemeta()

Full Access
Question # 27

What is the output of the following code?

1

2 function append($str)

3 {

4 $str = $str.'append';

5 }

6

7 function prepend(&$str)

8 {

9 $str = 'prepend'.$str;

10 }

11

12 $string = 'zce';

13 append(prepend($string));

14 echo $string;

15 ?>

A.

zceappend

B.

prependzceappend

C.

prependzce

D.

zce

Full Access
Question # 28

What will the following code print?

echo addslashes('I am a small "HTML" string, which is

\'invalid\'.');

A.

I am a small "HTML" string, which is 'invalid'.

B.

I am a small \"HTML\" string, which is \'invalid\'.

C.

I am a small \"HTML\" string, which is \\'invalid\\'.

D.

I am a small \"HTML\" string, which is \\\'invalid\\\'.

E.

I am a \small\<\/b\> "HTML" string, which is 'invalid'\<\/u\>.

Full Access
Question # 29

What will the following code piece print?

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

A.

Applas end benenes

B.

Epplas end benenes

C.

Apples and bananas

D.

Applas end bananas

Full Access
Question # 30

You analyze the code of a colleague and see a call to the function quotemeta(). You give the string "Holy $%&[. What's going on?" as a parameter to it. What will it output?

A.

Holy $%&[. What's going on?

B.

Holy \$%&\[\. What's going on\?

C.

Holy $%&[. What\'s going on?

D.

Holy \$\%\&\[\. What\'s going on\?

Full Access
Question # 31

How can you redirect a client to another page using PHP?

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

Full Access
Question # 32

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

A.

root, dir, file

B.

dirname, filename, fileextension

C.

dirname, basename, extensio

D.

path, file

Full Access