Cause all that matters here is passing the Zend Technologies 200-550 exam. Cause all that you need is a high score of 200-550 Zend Certified PHP Engineer exam. The only one thing you need to do is downloading Examcollection 200-550 exam study guides now. We will not let you down with our money-back guarantee.

Q33. Which line of code can be used to replace the INSERT comment in order to output "hello"?

class C {

public $ello = 'ello' public $c;

public $m;

function construct($y) {

$this->c = static function($f) {

// INSERT LINE OF CODE HERE

};

$this->m = function() { return "h";

};

}

}

$x = new C("h");

$f = $x->c; echo $f($x->m);

A. return $this->m() . "ello";

B. return $f() . "ello";

C. return "h". $this->ello;

D. return $y . "ello";

Answer: B


Q34. The following form is loaded in a browser and submitted, with the checkbox activated:

<form method="post">

<input type="checkbox" name="accept" />

</form>

In the server-side PHP code to deal with the form data, what is the value of

$_POST['accept'] ?

A. accept

B. ok

C. true

D. on

Answer: D


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

A. application/x-www-form-urlencoded

B. http/post

C. text/html

D. object/multipart-formdata

Answer: A


Q36. How should you track errors on your production website?

A. Enabling display_errors

B. Enabling log_errors

C. Having a site-wide exception handler

D. Setting error_reporting to E_ALL & ~E_NOTICE

Answer: B


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

A. ob_start()

B. set_write_buffer()

C. stream_set_write_buffer()

D. Change the output_buffering INI setting via ini_set() function

Answer: C


Q38. What is the output of the following code?

try {

class MyException extends Exception {}; try {

throw new MyException;

}

catch (Exception $e) { echo "1:";

throw $e;

}

catch (MyException $e) { echo "2:";

throw $e;

}

}

catch (Exception $e) { echo get_class($e);

}

A. A parser error, try cannot be followed by multiple catch

B. 1:

C. 2:

D. 1:Exception

E. 1:MyException

F. 2:MyException

G. MyException

Answer: E


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

A. $json = new Json($jsonValue); $value = $json->decode();

B. $value = Json::decode($jsonValue);

C. $value = json_decode($jsonValue);

D. $value = Json::fromJson($jsonValue);

Answer: C


Q40. When a query that is supposed to affect rows is executed as part of a transaction, and reports no affected rows, it could mean that: (Choose 2)

A. The transaction failed

B. The transaction affected no lines

C. The transaction was rolled back

D. The transaction was committed without error

Answer: A,B


Q41. 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


Q42. Which of the following expressions will evaluate to a random value from an array below?

$array = array("Sue","Mary","John","Anna");

A. array_rand($array);

B. array_rand($array, 1);

C. shuffle($array);

D. $array[array_rand($array)];

E. array_values($array, ARRAY_RANDOM);

Answer: D


Q43. Is the following code vulnerable to SQL Injection ($mysqli is an instance of the MySQLi class)?

$age = $mysqli->real_escape_string($_GET['age']);

$name = $mysqli->real_escape_string($_GET['name']);

$query = "SELECT * FROM `table` WHERE name LIKE '$name' AND age = $age";

$results = $mysqli->query($query);

A. No, the code is fully protected from SQL Injection.

B. Yes, because the $name variable is improperly escaped.

C. Yes, because the $name variable and the $age variable is improperly escaped.

D. Yes, because the $age variable is improperly escaped.

E. Yes, because you cannot prevent SQL Injection when using MySQLi

Answer: D


Q44. You'd like to use the class MyDBConnection that's defined in the MyGreatFramework\MyGreatDatabaseAbstractionLayer namespace, but you want to minimize *as much as possible* the length of the class name you have to type. What would you do?

A. Import the MyGreatFramework namespace

B. Import the MyGreatFramework\MyGreatDatabaseAbstractionLayer namespace

C. Alias MyGreatFramework\MyGreatDatabaseAbstractionLayer\MyDBConnection to a shorter name

D. Alias MyGreatFramework\MyGreatDatabaseAbstractionLayer to a shorter name

Answer: C


Q45. 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


Q46. Which of these statements about PDO is NOT true?

A. PDO has built-in support for Large Objects (LOBs).

B. Placeholders within PDO prepared statements need to be named.

C. When something goes wrong, PDO can throw an instance of its own exception class.

D. PDO does not emulate missing database features.

Answer: B


Q47. What is the output of the following code?

function ratio ($x1 = 10, $x2)

{

if (isset ($x2)) { return $x2 / $x1;

}

}

echo ratio (0);

A. 0

B. An integer overflow error

C. A warning, because $x1 is not set

D. A warning, because $x2 is not set

E. A floating-point overflow error

F. Nothing

Answer: D


Q48. How many elements does the array $matches from the following code contain?

$str = "The cat sat on the roof of their house.";

$matches = preg_split("/(the)/i", $str, -1, PREG_SPLIT_DELIM_CAPTURE);

A. 2

B. 3

C. 4

D. 7

E. 9

Answer: D