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

Home > Zend > Zend Certification > 200-530

200-530 Zend PHP 5.3 Certification Question and Answers

Question # 4

Given the following array:

$a = array(28, 15, 77, 43);

Which function will remove the value 28 from $a?

A.

array_shift()

B.

array_pop()

C.

array_pull()

D.

array_unshift()

Full Access
Question # 5

What is the difference between "print" and "echo"?

A.

There is no difference.

B.

Print returns length of data printed and echo does not

C.

Echo returns length of the data printed and print does not

D.

Print buffers the output, while echo does not

E.

None of the above

Full Access
Question # 6

REST is a(n) ...

A.

Web service protocol similar to SOAP with a strict XML schema.

B.

Principle to exchange information using XML and HTTP.

C.

API to get information from social networking sites.

Full Access
Question # 7

In the following code, which class can be instantiated?

1

2 abstract class Graphics {

3 abstract function draw($im, $col);

4 }

5

6 abstract class Point1 extends Graphics {

7 public $x, $y;

8 function __construct($x, $y) {

9 $this->x = $x;

10 $this->y = $y;

11 }

12 function draw($im, $col) {

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

14 }

15 }

16

17 class Point2 extends Point1 { }

18

19 abstract class Point3 extends Point2 { }

20 ?>

A.

Graphics

B.

Point1

C.

Point2

D.

Point3

E.

None, the code is invalid

Full Access
Question # 8

What function should be used to escape command line arguments that are passed to commands executed from PHP?

A.

addslashes()

B.

quotemeta()

C.

escapeshellarg()

D.

escapeshellcmd()

E.

passthru()

Full Access
Question # 9

Which 2.17of the following formats is used to describe web services?

A.

WSDL

B.

UDDI

C.

SOAP

D.

XLANG

Full Access
Question # 10

Which methods can be used to overload object properties? (Choose 2)

A.

set(), get()

B.

__set(), __get()

C.

__put(), __receive(), __exists()

D.

set(), get(), isset()

E.

__isset(), __unset()

Full Access
Question # 11

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

What is the name of the key pointing to the domain name in the array returned by parse_url()?

A.

domain

B.

path

C.

host

D.

2

E.

scheme

Full Access
Question # 13

Which of the following are valid SoapClient calls? (Choose 2)

A.

$client = new SoapClient("weather.wsdl");

B.

$client = new SoapClient;

C.

$client = new SoapClient(null, array("location" =>

"http://example.com/weather ", "uri" => "http://test-uri.com/ "));

D.

$client = new SoapClient(null, array());

Full Access
Question # 14

Which requirements need NOT be met so that file uploads work?

A.

The PHP directive file_uploads must be set to on

B.

The form's method attribute must be set to "post"

C.

Sate mode must be turned off so that the uploaded file an be written to the server

D.

The form's enctype attribute must be set to "multipart/form-data"

Full Access
Question # 15

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.

Full Access
Question # 16

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

Full Access
Question # 17

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

What function can be used to retrieve an array of current options for a stream context?

A.

stream_context_get_params

B.

stream_context_get_default

C.

stream_context_get_options

D.

The 'options' element of the stream_get_rneta_data return value

Full Access
Question # 19

Given the following code, what is correct?

function f(stdClass &$x = NULL) { $x = 42;

}

$z = new stdClass;

f($z);

var_dump($z);

A.

Error: Typehints cannot be NULL

B.

Error: Typehints cannot be references

C.

Result is NULL

D.

Result is object of type stdClass

E.

Result is 42

Full Access
Question # 20

Which of the following code snippets is correct? (Choose 2)

a)

interface Drawable {

abstract function draw();

}

b)

interface Point {

function getX();

function getY();

}

c)

interface Line extends Point {

function getX2();

function getY2();

}

d)

interface Circle implements Point {

function getRadius();

}

A.

a)

B.

b)

C.

c)

D.

d)

Full Access
Question # 21

Is the following code piece E_STRICT compliant?

final class Testing {

private $test;

public function tester() {

return "Tested!";

}}

A.

Yes

B.

No

Full Access
Question # 22

Which of the listed changes would you make to the following PHP 4 code in order to make it most compliant with PHP 5? (Choose 2)

class Car {

var $model;

function Car($model) {

$this->model = $model;

} function toString() {

return "I drive a $this->model.";

}}

$c = new Car('Dodge');

echo $c->toString();

?>

A.

Change var to public or private

B.

Change function Car to function_construct

C.

Change "I drive a $this->model." to "I drive a {$this->model}."

D.

Change function toString()to static function toString()

Full Access
Question # 23

In a shared hosting environment, session data can be read by PHP scripts written by any user. How can you prevent this?

A.

Store session data in a different location with session. save_Path .

B.

Store session data in a database.

C.

Enable safe_mode .

D.

Set session.name to something unique.

Full Access
Question # 24

Which of the following configuration directives increase the risk of remote code injection when enabled? (Choose 2)

A.

allow_url_fopen

B.

register_globals

C.

magic_quotes_gpc

D.

safe_mode

Full Access
Question # 25

Which of the following parts must a XML document have in order to be well-formed?

A.

An XML declaration

B.

A root element

C.

A specified encoding

D.

A reference to either a DTD or an XML schema definition

Full Access
Question # 26

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

Full Access
Question # 27

What function can reverse the order of values in an array without the loss of key information?

A.

array_flip()

B.

array_reverse()

C.

rsort()

D.

krsort()

E.

array_multisort()

Full Access
Question # 28

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

Full Access
Question # 29

What type of class definition can be used to define multiple inheritance?

A.

Class

B.

Abstract

C.

Interface

D.

Final

Full Access
Question # 30

What is the output of the following code?

printf('%4$d %2$s sit on 2 trees and eat %3$3.2f %1$s', "bananas",

"monkeys", 9, 99);

A.

%4$d %2$s sit on 2 trees and eat %3$3.2f %1$s

B.

99 monkeys sit on 2 trees and eat 9.00 bananas

C.

Monkeys Bananas sit on 2 trees and eat 9 99

D.

9 monkeys sit on 2 trees and eat 99 bananas

Full Access
Question # 31

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

A script residing at http://example.com/phpcert/cookies.php contains the following code:

1

2 setcookie('name1', 'value1', time() + 60*60*24, '/');

3 setcookie('name1', 'value2');

4 ?>

The web browser is configured to accept all cookies. How many cookies will be set by this script?

A.

0

B.

1

C.

2

D.

3

Full Access
Question # 33

What does the chown() function do?

A.

Change the file permissions.

B.

Change the owner of the file.

C.

Change the group of the file.

D.

Checks if the file is accessible.

Full Access
Question # 34

You want to access the 3rd character of a string, contained in the variable $test. Which of the following possibilities work?(Choose 2)

A.

echo $test(3)

B.

echo $test[2];

C.

echo $test(2);

D.

echo $test{2};

E.

echo $test{3}

Full Access
Question # 35

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

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

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

What is the output of the following code?

A.

false-false

B.

false-true

C.

true-false

D.

true-true

Full Access