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

Zend 200-500 - Zend PHP 5 Certification

Page: 2 / 7
Total 219 questions

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.

You work for a shared hosting provider, and your supervisor asks you to disable user scripts to dynamically load PHP extensions using the dl() function. How can you do this? (Choose 2)

A.

Set enable_dl to Off in the server's php.ini configuration file.

B.

Add dl to the current value of disable_functions in the server's php.ini configuration file.

C.

Add dl to the current value of disable_classes in the server's php.ini configuration file.

D.

Write a custom function called dl(), save it under the name prepend.inc and then set the auto_prepend_file directive to prepend.inc in php.ini.

Identify the security vulnerability in the following example:

1

2 echo "Welcome, {$_POST['name']}.";

3 ?>

A.

SQL Injection

B.

Cross-Site Scripting

C.

Remote Code Injection

D.

None of the above

What is the return value of the following code?

strpos("me myself and I", "m", 2)

A.

2

B.

3

C.

4

D.

0

E.

1

What is the function of backtick (`) characters in PHP?

A.

Same as single-quotes, used to enclose strings.

B.

Escape operators.

C.

No special meaning.

D.

Execute the enclosed string as a command.

E.

Error control operators.

Which of the following data types cannot be directly manipulated by the client?

A.

Cookie Data

B.

Session Data

C.

Remote IP Address

D.

User Agent

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)

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

What PHP function can be used to remove a local file?

A.

A) rmdir()

B.

B) unlink()

C.

C) rm()

D.

D) delete()

E.

E) delete_file()

Which of the following functions can help prevent session fixation vulnerabilities?

A.

magic_quotes_gpc()

B.

strip_tags()

C.

addslashes()

D.

session_regenerate_id()