Black Friday Special Limited Time 70% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: cramtick70

200-530 Zend PHP 5.3 Certification Questions and Answers

Questions 4

Consider the following XML code:

PHP 5 Power Programming

Learning PHP 5

Which of the following SimpleXML calls print the name of the second book?

(Let $xml=simplexml_load_file("books.xml");) (Choose 2)

Options:

A.

echo $xml->books->book[2];

B.

echo $xml->books->book[1];

C.

echo $xml->book[1];

D.

echo $xml->xpath("/books/book[@id=2]");

E.

$c = $xml->children(); echo $c[1];

Buy Now
Questions 5

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

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

$b = sort($a);

Options:

A.

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

B.

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

C.

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

D.

None of the above

Buy Now
Questions 6

Which elements can be encapsulated by namespaces?

Options:

A.

Only classes

B.

Classes, functions and constants

C.

Classes, functions, constants and variables

Buy Now
Questions 7

After performing the following operations:

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

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

What will be the value of $a?

Options:

A.

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

B.

array(2, 1, 0)

C.

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

D.

None of the above

Buy Now
Questions 8

Which of the following did not result in an output error in PHP 4 but does in PHP 5?

Options:

A.

Using 'var' as an access modifier.

B.

Assigning a new object instance to $this in a constructor.

C.

Passing an object by-reference.

D.

Passing an object by-value.

Buy Now
Questions 9

What is the result of the following bitwise operation in PHP?

1 ^ 2

Options:

A.

1

B.

3

C.

2

D.

4

Buy Now
Questions 10

What is the name of the PHP function used to automatically load non-yet defined classes?

Options:

A.

Autoload()

B.

__autoload()

C.

__catch()

D.

Load()

E.

loadClass()

Buy Now
Questions 11

What will the following code piece print?

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

Options:

A.

Applas end benenes

B.

Epplas end benenes

C.

Apples and bananas

D.

Applas end bananas

Buy Now
Questions 12

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)

Options:

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.

Buy Now
Questions 13

Which of the following data types is implicitly passed by reference in PHP 5 while it is passed by value in PHP 4?

Options:

A.

Class

B.

String

C.

Object

D.

Array

Buy Now
Questions 14

What is the output of the following code?

echo '1' . (print '2') + 3;

Options:

A.

123

B.

213

C.

142

D.

214

E.

Syntax error

Buy Now
Questions 15

Given a JSON-encoded string, which code sample correctly indicates how to decode the string to native PHP values?

Options:

A.

Option A

B.

Option B

C.

Option C

D.

Option D

Buy Now
Questions 16

Which combination of the following filtering techniques prevents cross-site scripting (XSS) vulnerabilities?

Options:

A.

Strip all occurrences of the string $lt; script.

B.

Strip all occurrences of the string javascript.

C.

Enable magic_quotes_gpc .

D.

None of the above.

Buy Now
Questions 17

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

Options:

A.

3

B.

4

C.

5

D.

6

Buy Now
Questions 18

What will be the value of $b after running the following code?

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

$b = (array)$a;

Options:

A.

TRUE

B.

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

C.

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

D.

None of the above

Buy Now
Questions 19

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 ?>

Options:

A.

0

B.

1

C.

2

D.

6

E.

7

Buy Now
Questions 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();

}

Options:

A.

a)

B.

b)

C.

c)

D.

d)

Buy Now
Questions 21

What will be the result of the following operation?

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

Options:

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)

Buy Now
Questions 22

Can a private static member be accessed from a public static method of the same class?

Options:

A.

Yes

B.

No

C.

Only if the class is defined as an abstract

Buy Now
Questions 23

PHP's array functions such as array_values() and array_key_exists() can be used on an object if the object...

Options:

A.

implements Traversable

B.

is an instance of ArrayObject

C.

implements ArrayAccess

D.

None of the above

Buy Now
Questions 24

What is the output of the following code?

$a = 'a'; $b = 'b';

echo isset($c) ? $a.$b.$c : ($c = 'c').'d';

Options:

A.

abc

B.

cd

C.

0d

Buy Now
Questions 25

Is the following code piece E_STRICT compliant?

final class Testing {

private $test;

public function tester() {

return "Tested!";

}}

Options:

A.

Yes

B.

No

Buy Now
Questions 26

What is the content of $c after the following code has executed?

$a = 2;

$b = 3;

$c = ($a++ * ++$b);

Options:

A.

0

B.

5

C.

8

D.

4

Buy Now
Questions 27

Is the following code piece E_STRICT compliant?

final class Testing {

var $test = 0;

public function tester() {

return "Tested!";

}}

Options:

A.

Yes

B.

No

Buy Now
Questions 28

Which of the following statements is correct?

Options:

A.

Interfaces can extend only one interface

B.

Interfaces can extend more than one interface

C.

Interfaces can inherit a method from different interfaces

D.

Interfaces can redeclare inherited methods

Buy Now
Questions 29

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

Options:

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

Buy Now
Questions 30

What object method specifies post-serialization behavior for an object?

Options:

A.

__sleep()

B.

__wakeup()

C.

__set_state()

D.

__get()

E.

__autoload()

Buy Now
Questions 31

What is the result of the following code?

$a = 1;

$b = "1";

var_dump($a === $b);

Options:

A.

bool(true

B.

bool(false)

C.

Parser error

D.

NULL

Buy Now
Questions 32

The constructs for(), foreach(), and each() can all be used to iterate an object if the object

Options:

A.

implements ArrayAccess

B.

implements Iterator

C.

implements Iterator and ArrayAccess

D.

None of the above

Buy Now
Questions 33

PHP’s array functions such as array_values() can be used on an object is the oject….

Options:

A.

implement Traversable

B.

is an instance of ArrayObject

C.

implements ArrayAccess

D.

None of the above

Buy Now
Questions 34

Which options do you have in PHP to set the expiry date of a session?

Options:

A.

Set the session.duration directive in php.ini

B.

Set session cookie expiry date locally via session_set_cookie_params()

C.

Set session expiry date locally via session_cache_expire()

D.

None of the above

Buy Now
Questions 35

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

Options:

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

Buy Now
Questions 36

When you need to process the values of columns in a database, you should:

Options:

A.

Only use built-in database functions

B.

Always use read the values as-is from the database and then process them with PHP

C.

Use built-in database functions for simple processing, and perform more complicated logic in PHP

D.

Use built-in database functions for complicated logic, and perform simpler functions in PHP

Buy Now
Questions 37

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

Options:

A.

A) rmdir()

B.

B) unlink()

C.

C) rm()

D.

D) delete()

E.

E) delete_file()

Buy Now
Questions 38

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

Options:

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.

Buy Now
Exam Code: 200-530
Exam Name: Zend PHP 5.3 Certification
Last Update: Nov 25, 2024
Questions: 254
200-530 pdf

200-530 PDF

$25.5  $84.99
200-530 Engine

200-530 Testing Engine

$30  $99.99
200-530 PDF + Engine

200-530 PDF + Testing Engine

$40.5  $134.99