Summer Special 60% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: bestdeal

Free Zend 200-550 Practice Exam with Questions & Answers | Set: 7

Questions 61

What content-type is required when sending an HTTP POST using JavaScript to ensure that PHP can access the data?

Options:
A.

application/x-www-form-urlencoded

B.

http/post

C.

text/html

D.

object/multipart-formdata

Zend 200-550 Premium Access
Questions 62

Which of the following tasks can be achieved by using magic methods? (Choose 3)

Options:
A.

Initializing or uninitializing object data

B.

Creating a new stream wrapper

C.

Creating an iterable object

D.

Processing access to undefined methods or properties

E.

Overloading operators like +, *, etc.

F.

Converting objects to string representation

Questions 63

What is the output of the following code?

class Base {

protected static function whoami() {

echo "Base ";

}

public static function whoareyou() {

static::whoami();

}

}

class A extends Base {

public static function test() {

Base::whoareyou();

self::whoareyou();

parent::whoareyou();

Options:
A.

:whoareyou();

static::whoareyou();

}

public static function whoami() {

echo "A ";

}

}

class B extends A {

public static function whoami() {

echo "B ";

}

}

B.

:test();

C.

B B B B B

D.

Base A Base A B

E.

Base B B A B

F.

Base B A A B

Questions 64

What is the output of the following code?

function append($str)

{

$str = $str.'append';

}

function prepend(&$str)

{

$str = 'prepend'.$str;

}

$string = 'zce';

append(prepend($string));

echo $string;

Options:
A.

zceappend

B.

prependzceappend

C.

prependzce

D.

zce

Questions 65

Consider the following table data and PHP code. What is a possible 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);

$cmd = "SELECT name, email FROM users LIMIT 1";

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

$stmt->execute();

$result = $stmt->fetchAll(PDO::FETCH_BOTH);

$row = $result[0];

Options:
A.

The value of $row is `array(0 => 'anna', 1 => 'alpha@example.com')`.

B.

The value of $row is `array('name' => 'anna', 'email' => 'alpha@example.com')`.

C.

The value of $row is `array(0 => 'anna', 'name' => 'anna', 1 => 'alpha@example.com', 'email' => 'alpha@example.com')`.

D.

The value of $result is `array('anna' => 'alpha@example.com')`.

Questions 66

What is the output of the following code?

function z($x) {

return function ($y) use ($x) {

return str_repeat($y, $x);

};

}

$a = z(2);

$b = z(3);

echo $a(3) . $b(2);

Options:
A.

22333

B.

33222

C.

33322

D.

222333