Exam Code: 200-550 (Practice Exam Latest Test Questions VCE PDF)
Exam Name: Zend Certified PHP Engineer
Certification Provider: Zend Technologies
Free Today! Guaranteed Training- Pass 200-550 Exam.

2021 Sep 200-550 exam answers

Q91. Which of the following are valid identifiers? (Choose 3)

A. function 4You() { }

B. function _4You() { }

C. function object() { }

D. $1 = "Hello";

E. $_1 = "Hello World";

Answer: B,C,E


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

A. echo $test(3);

B. echo $test[2];

C. echo $test(2);

D. echo $test{2};

E. echo $test{3};

Answer: B,D


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

A. autoload()

B. autoload()

C. catch()

D. load()

E. loadClass()

Answer: B


Q94. CORRECT TEXT

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"

Answer: static


Q95. When retrieving data from URLs, what are valid ways to make sure all file_get_contents calls send a certain user agent string? (Choose 2)

A. $default_opts = array('http'=>array('user_agent'=>"My Cool Browser"));

$default = stream_context_set_default($default_opts);

B. stream_context_set_option("user_agent", "My Cool Browser");

C. ini_set('user_agent', "My Cool Browser");

D. stream_context_set_option($context, "http", "user_agent", "My Cool Browser");

Answer: A,C


200-550 exam engine

Refresh 200-550 exam:

Q96. What is the output of the following code?

$a = 3; switch ($a) {

case 1: echo 'one' break; case 2: echo 'two' break; default: echo 'four' break; case 3: echo 'three' break;

}

A. one

B. two

C. three

D. four

Answer: C


Q97. CORRECT TEXT

Which value will be assigned to the key 0 in this example?

$foo = array(true, '0' => false, false => true);

Answer: true


Q98. What is the method used to execute XPath queries in the SimpleXML extension?

A. xpathQuery()

B. xpath()

C. simpleXMLXpath()

D. query()

E. evaluate()

Answer: B


Q99. An HTML form has two submit buttons. After submitting the form, how can you determine with PHP which button was clicked?

A. An HTML form may only have one button.

B. You cannot determine this with PHP only. You must use JavaScript to add a value to the URL depending on which button has been clicked.

C. Put the two buttons in different forms, but make sure they have the same name.

D. Assign name and value attributes to each button and use $_GET or $_POST to find out which button has been clicked.

Answer: D


Q100. What is the output of the following code?

function fibonacci (&$x1 = 0, &$x2 = 1)

{

$result = $x1 + $x2;

$x1 = $x2;

$x2 = $result;

return $result;

}

for ($i = 0; $i < 10; $i++) { echo fibonacci() . ','

}

A. An error

B. 1,1,1,1,1,1,1,1,1,1,

C. 1,1,2,3,5,8,13,21,34,55,

D. Nothing

Answer: B