Winter Sale - Special Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: dpm65

Hot Vendors

200-550 Zend Certified PHP Engineer Questions and Answers

Questions 4

Which of the following items in the $_SERVER superglobal are important for authenticating the client when using HTTP Basic authentication? (Choose 2)

Options:

A.

PHP_AUTH_TYPE

B.

PHP_AUTH_PASSWORD

C.

PHP_AUTH_DIGEST

D.

PHP_AUTH_PW

E.

PHP_AUTH_USER

Buy Now
Questions 5

Which class of HTTP status codes is used for redirections?

Options:

A.

2XX

B.

3XX

C.

4XX

D.

5XX

Buy Now
Questions 6

Consider the following two files. When you run test.php, what would the output look like?

test.php:

include "MyString.php";

print ",";

print strlen("Hello world!");

MyString.php:

namespace MyFramework\String;

function strlen($str)

{

return \strlen($str)*2; // return double the string length

}

print strlen("Hello world!")

Options:

A.

12,12

B.

12,24

C.

24,12

D.

24,24

E.

PHP Fatal error: Cannot redeclare strlen()

Buy Now
Questions 7

What function allows resizing of PHP's file write buffer?

Options:

A.

ob_start()

B.

set_write_buffer()

C.

stream_set_write_buffer()

D.

Change the output_buffering INI setting via ini_set() function

Buy Now
Questions 8

Given the following code, what is correct?

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

$z = new stdClass;

f($z);

var_dump($z);

Options:

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

Buy Now
Questions 9

In the following code, which line should be changed so it outputs the number 2:

class A {

protected $x = array(); /* A */

public function getX() { /* B */

return $this->x; /* C */

}

}

$a = new A(); /* D */

array_push($a->getX(), "one");

array_push($a->getX(), "two");

echo count($a->getX());

Options:

A.

No changes needed, the code would output 2 as is

B.

Line A, to: protected &$x = array();

C.

Line B, to: public function &getX() {

D.

Line C, to: return &$this->x;

E.

Line D, to: $a =& new A();

Buy Now
Questions 10

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 11

Which of the following statements is NOT correct?

Options:

A.

Only methods can have type hints

B.

Typehints can be optional

C.

Typehints can be references

Buy Now
Questions 12

Consider the following code. Which keyword should be used in the line marked with "KEYWORD" instead of "self" to make this code work as intended?

abstract class Base {

protected function __construct() {

}

public static function create() {

return new self(); // KEYWORD

}

abstract function action();

}

class Item extends Base {

public function action() { echo __CLASS__; }

}

$item = Item::create();

$item->action(); // outputs "Item"

Options:

Buy Now
Questions 13

What is the name of the method that can be used to provide read access to virtual properties in a class?

Options:

A.

__call()

B.

__get()

C.

__set()

D.

__wakeup()

E.

__fetch()

Buy Now
Questions 14

Which PHP function retrieves a list of HTTP headers that have been sent as part of the HTTP response or are ready to be sent?

Options:

A.

header()

B.

headers()

C.

headers_list()

D.

headers_sent()

E.

getresponseheaders()

Buy Now
Questions 15

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

Buy Now
Questions 16

Consider the following code. What change must be made to the class for the code to work as written?

class Magic {

protected $v = array("a" => 1, "b" => 2, "c" => 3);

public function __get($v) {

return $this->v[$v];

}

}

$m = new Magic();

$m->d[] = 4;

echo $m->d[0];

Options:

A.

Nothing, this code works just fine.

B.

Add __set method doing $this->v[$var] = $val

C.

Rewrite __get as: public function __get(&$v)

D.

Rewrite __get as: public function &__get($v)

E.

Make __get method static

Buy Now
Questions 17

What is the output of the following code?

class A {

public $a = 1;

public function __construct($a) { $this->a = $a; }

public function mul() {

return function($x) {

return $this->a*$x;

};

}

}

$a = new A(2);

$a->mul = function($x) {

return $x*$x;

};

$m = $a->mul();

echo $m(3);

Options:

A.

9

B.

6

C.

0

D.

3

Buy Now
Questions 18

Which of the following is true about stream contexts? (Choose 2)

Options:

A.

A context can modify or enhance the behavior of a stream

B.

A context indicates what session the stream is part of

C.

A context is a set of parameters and stream wrapper specific options

D.

Contexts are created with new Stream_Context();

Buy Now
Questions 19

PHP's array functions such as array_values() 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 20

An object can be counted with count() and sizeof() if it...

Options:

A.

implements ArrayAccess

B.

has a public __count() method

C.

was cast to an object from an array

D.

None of the above

Buy Now
Questions 21

Under what condition may HTTP headers be set from PHP if there is content echoed prior to the header function being used?

Options:

A.

headers_sent() returns true

B.

Output buffering is enabled

C.

The client supports local buffering

D.

The webserver uses preemptive mode

Buy Now
Questions 22

Which of the following statements about SOAP is NOT true?

Options:

A.

SOAP is also a request-/response-based protocol.

B.

SOAP can be transported using SMTP, HTTP and other protocols.

C.

SOAP requires developers to use WSDL.

D.

SOAP traffic via HTTP can be encrypted and compressed just like other HTTP requests.

Buy Now
Questions 23

What does the __FILE__ constant contain?

Options:

A.

The filename of the current script.

B.

The full path to the current script.

C.

The URL of the request made.

D.

The path to the main script.

Buy Now
Questions 24

What types of HTTP authentication are supported by PHP? (Choose 2)

Options:

A.

Basic

B.

Advanced

C.

Strict

D.

Digest

E.

Realm

Buy Now
Questions 25

The XML document below has been parsed into $xml via SimpleXML. How can the value of tag accessed?

Value

Options:

A.

$xml->bar['foo']

B.

$xml->bar->foo

C.

$xml['document']['bar']['foo']

D.

$xml->document->bar->foo

E.

$xml->getElementByName('foo');

Buy Now
Questions 26

Which of the following superglobals does not necessarily contain data from the client?

Options:

A.

$_POST

B.

$_SESSION

C.

$_GET

D.

$_SERVER

Buy Now
Questions 27

What purpose do namespaces fulfill?

Options:

A.

Encapsulation

B.

Alternative to classes

C.

Improved performance

D.

All of the above

Buy Now
Questions 28

Which of the following PHP functions can be used to set the HTTP response code? (Choose 2)

Options:

A.

header_add()

B.

header()

C.

http_set_status()

D.

http_response_code()

E.

http_header_set()

Buy Now
Questions 29

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

Buy Now
Questions 30

Which constant must be passed as the second argument to htmlentities() to convert single quotes (') to HTML entities?

Options:

A.

TRUE

B.

FALSE

C.

ENT_QUOTES

D.

ENT_NOQUOTES

E.

ENT_COMPAT

Buy Now
Questions 31

What is the result of the following code?

define('PI', 3.14);

class T

{

const PI = PI;

}

class Math

{

const PI = T::PI;

}

echo Math::PI;

Options:

A.

Parse error

B.

3.14

C.

PI

D.

T::PI

Buy Now
Questions 32

What is the output of the following code?

$f = function () { return "hello"; };

echo gettype($f);

Options:

A.

hello

B.

string

C.

object

D.

function

Buy Now
Questions 33

Given the following DateTime objects, what can you use to compare the two dates and indicate that $date2 is the later of the two dates?

$date1 = new DateTime('2014-02-03');

$date2 = new DateTime('2014-03-02');

Options:

A.

$date2 > $date1

B.

$date2 < $date1

C.

$date1->diff($date2) < 0

D.

$date1->diff($date2) > 0

Buy Now
Exam Code: 200-550
Exam Name: Zend Certified PHP Engineer
Last Update: Nov 16, 2024
Questions: 223

PDF + Testing Engine

$56  $159.99

Testing Engine

$42  $119.99
buy now 200-550 testing engine

PDF (Q&A)

$35  $99.99
buy now 200-550 pdf
dumpsmate guaranteed to pass
24/7 Customer Support

DumpsMate's team of experts is always available to respond your queries on exam preparation. Get professional answers on any topic of the certification syllabus. Our experts will thoroughly satisfy you.

Site Secure

mcafee secure

TESTED 21 Nov 2024