Weekend Sale Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: xmas50

Zend 200-530 - Zend PHP 5.3 Certification

Page: 7 / 8
Total 254 questions

What is the output of the following code?

1

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

3 $a[$i] = $i;

4 }

5 echo count($a);

6 ?>

A.

0

B.

1

C.

2

D.

6

E.

7

What function is ideal for outputting contents of a static file to screen?

A.

file_get_contents()

B.

readfile()

C.

fread()

D.

include()

E.

require()

F.

file()

The following code piece should print "PHP is cool", but unexpectedly, it just prints "cool". How would you correct it?

echo str_replace('PHP is a pain.', 'a pain', 'cool');

A.

str_replace('PHP is a pain.', 'cool', 'a pain');

B.

str_replace('a pain', 'cool', 'PHP is a pain.');

C.

str_replace('cool', 'a pain', 'PHP is a pain.');

What is "instanceof" an example of:

A.

a boolean

B.

an operator

C.

a function

D.

a language construct

E.

a class magic

Identify the security vulnerability in the following example:

1

2 mail('feedback@example.org',

3 'Feddback',

4 'Here is my feedback.',

5 "From: {$_COOKIE['email']}");

6 ?>

A.

Remote Code Injection

B.

Cross-Site Request Forgeries

C.

Email Injection

D.

None of the above

After running this sort, what will be the value of $b?

$a = array('_!', 'def', 0);

$b = sort($a);

A.

array(0, 'def', '_!')

B.

array('_!', 0, 'def')

C.

array('def', 0, '_!)

D.

None of the above

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

A.

dom_import_simplexml()

B.

dom_export_simplexml()

C.

simplexml_import_dom()

D.

SimpleXML2Dom()

E.

None of the above.

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

A.

getAttributeNS()

B.

getAttribute()

C.

hasAttribute()

D.

hasAttributeNS()

What is the error in the following declaration of a static class method?

1

2 class car {

3 static $speeds = array(

4 'fast',

5 'slow',

6 'medium',

7 );

8

9 static function getSpeeds()

10 {

11 return $this->speeds;

12 }

13 }

14 ?>

A.

Static methods must not return a value.

B.

The use of $this from within static methods is not possible.

C.

Static methods need the method keyword instead of the function keyword.

D.

There is no static keyword in PHP.

After performing the following operations:

$a = array('a', 'b', 'c');

$a = array_keys(array_flip($a));

What will be the value of $a?

A.

array('c', 'b', 'a')

B.

array(2, 1, 0)

C.

array('a', 'b', 'c')

D.

None of the above