Pass the Zend PHP and Zend Framework Certifications 200-550 Questions and answers with CertsForce

Viewing page 6 out of 7 pages
Viewing questions 51-60 out of questions
Questions # 51:

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

function modifyArray (&$array)

{

foreach ($array as &$value)

{

$value = $value + 1;

}

$value = $value + 2;

}

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

modifyArray($array);

Options:

A.

2, 3, 4


B.

2, 3, 6


C.

4, 5, 6


D.

1, 2, 3


Expert Solution
Questions # 52:

What is the name of the function that allows you register a set of functions that implement user-defined session handling?

Options:

A.

session_set_handler()


B.

session_set_storage_handler()


C.

session_register_handler()


D.

session_set_save_handler()


Expert Solution
Questions # 53:

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

Options:

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

}


Expert Solution
Questions # 54:

Consider the following table data and PHP code. What is the outcome?

Table data (table name "users" with primary key "id"):

id name email

------- ----------- -------------------

1 anna alpha@example.com

2 betty beta@example.org

3 clara gamma@example.net

5 sue sigma@example.info

PHP code (assume the PDO connection is correctly established):

$dsn = 'mysql:host=localhost;dbname=exam';

$user = 'username';

$pass = '********';

$pdo = new PDO($dsn, $user, $pass);

try {

$cmd = "INSERT INTO users (id, name, email) VALUES (:id, :name, :email)";

$stmt = $pdo->prepare($cmd);

$stmt->bindValue('id', 1);

$stmt->bindValue('name', 'anna');

$stmt->bindValue('email', 'alpha@example.com');

$stmt->execute();

echo "Success!";

} catch (PDOException $e) {

echo "Failure!";

throw $e;

}

Options:

A.

The INSERT will succeed and the user will see the "Success!" message.


B.

The INSERT will fail because of a primary key violation, and the user will see the "Success!" message.


C.

The INSERT will fail because of a primary key violation, and the user will see a PDO warning message.


D.

The INSERT will fail because of a primary key violation, and the user will see the "Failure!" message.


Expert Solution
Questions # 55:

Which class of HTTP status codes is used for server error conditions?

Options:

A.

2XX


B.

3XX


C.

4XX


D.

5XX


Expert Solution
Questions # 56:

Which of these databases is NOT supported by a PDO driver?

Options:

A.

Microsoft SQL Server


B.

SQLite


C.

Microsoft Access


D.

Berkeley DB


Expert Solution
Questions # 57:

How many elements does the array $pieces contain after the following piece of code has been executed?

$pieces = explode("/", "///");

Options:

A.

0


B.

3


C.

4


D.

5


Expert Solution
Questions # 58:

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

Options:

A.

Strip all occurrences of the string <script .


B.

Strip all occurrences of the string javascript .


C.

Enable magic_quotes_gpc .


D.

None of the above.


Expert Solution
Questions # 59:

Which MIME type is always sent by a client if a JPEG file is uploaded via HTTP?

Options:

A.

image/jpeg


B.

image/jpg


C.

image/pjpeg


D.

Depends on the client system


Expert Solution
Questions # 60:

Which SPL class implements fixed-size storage?


Expert Solution
Viewing page 6 out of 7 pages
Viewing questions 51-60 out of questions